diff options
Diffstat (limited to 'dutmp.c')
-rw-r--r-- | dutmp.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -41,11 +41,9 @@ extern int dutmp_main(int argc, char **argv) | |||
41 | } | 41 | } |
42 | } | 42 | } |
43 | 43 | ||
44 | /* Kludge around the fact that the binary format for utmp has changed, and the | 44 | /* Kludge around the fact that the binary format for utmp has changed. */ |
45 | * fact the stupid libc doesn't have a reliable #define to announce that libc5 | 45 | #if __GNU_LIBRARY__ < 5 |
46 | * is being used. sigh. | 46 | /* Linux libc5 */ |
47 | */ | ||
48 | #if ! defined __GLIBC__ || defined __UCLIBC__ | ||
49 | while (read(file, (void*)&ut, sizeof(struct utmp))) { | 47 | while (read(file, (void*)&ut, sizeof(struct utmp))) { |
50 | printf("%d|%d|%s|%s|%s|%s|%s|%lx\n", | 48 | printf("%d|%d|%s|%s|%s|%s|%s|%lx\n", |
51 | ut.ut_type, ut.ut_pid, ut.ut_line, | 49 | ut.ut_type, ut.ut_pid, ut.ut_line, |
@@ -54,6 +52,7 @@ extern int dutmp_main(int argc, char **argv) | |||
54 | (long)ut.ut_addr); | 52 | (long)ut.ut_addr); |
55 | } | 53 | } |
56 | #else | 54 | #else |
55 | /* Glibc, uClibc, etc */ | ||
57 | while (read(file, (void*)&ut, sizeof(struct utmp))) { | 56 | while (read(file, (void*)&ut, sizeof(struct utmp))) { |
58 | printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n", | 57 | printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n", |
59 | ut.ut_type, ut.ut_pid, ut.ut_line, | 58 | ut.ut_type, ut.ut_pid, ut.ut_line, |