Contents of /trunk/utempter/patches/utempter-0.5.5.6-no_utmpx.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 768 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 768 byte(s)
-import
1 | --- utempter-0.5.5/utempter.c.mps 2004-12-11 14:54:06.000000000 +0100 |
2 | +++ utempter-0.5.5/utempter.c 2004-12-11 14:57:46.000000000 +0100 |
3 | @@ -11,7 +11,9 @@ |
4 | #include <sys/stat.h> |
5 | #include <sys/sysmacros.h> |
6 | #include <utmp.h> |
7 | +#ifndef __UCLIBC__ |
8 | #include <utmpx.h> |
9 | +#endif |
10 | #include <unistd.h> |
11 | |
12 | static void usage(void) { |
13 | @@ -82,7 +84,11 @@ |
14 | } |
15 | |
16 | int main(int argc, const char ** argv) { |
17 | +#ifndef __UCLIBC__ |
18 | struct utmpx utx; |
19 | +#else |
20 | + struct utmp utx; |
21 | +#endif |
22 | int add; |
23 | const char * device, * host; |
24 | struct passwd * pw; |
25 | @@ -154,8 +160,13 @@ |
26 | |
27 | gettimeofday(&utx.ut_tv, NULL); |
28 | |
29 | +#ifndef __UCLIBC__ |
30 | pututxline(&utx); |
31 | updwtmpx(_PATH_WTMP, &utx); |
32 | +#else |
33 | + pututline(&utx); |
34 | + updwtmp(_PATH_WTMP, &utx); |
35 | +#endif |
36 | |
37 | return 0; |
38 | } |