diff options
Diffstat (limited to 'dutmp.c')
-rw-r--r-- | dutmp.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -14,11 +14,17 @@ | |||
14 | #include "internal.h" | 14 | #include "internal.h" |
15 | #include <stdio.h> | 15 | #include <stdio.h> |
16 | #include <errno.h> | 16 | #include <errno.h> |
17 | #include <utmp.h> | ||
18 | #define BB_DECLARE_EXTERN | 17 | #define BB_DECLARE_EXTERN |
19 | #define bb_need_io_error | 18 | #define bb_need_io_error |
20 | #include "messages.c" | 19 | #include "messages.c" |
21 | 20 | ||
21 | #if defined(__GLIBC__) | ||
22 | #include <utmp.h> | ||
23 | #else | ||
24 | #include <utmp-wrap.h> | ||
25 | #define utmp new_utmp | ||
26 | #endif | ||
27 | |||
22 | static const char dutmp_usage[] = "dutmp [FILE]\n\n" | 28 | static const char dutmp_usage[] = "dutmp [FILE]\n\n" |
23 | "Dump utmp file format (pipe delimited) from FILE\n" | 29 | "Dump utmp file format (pipe delimited) from FILE\n" |
24 | "or stdin to stdout. (i.e. 'dutmp /var/run/utmp')\n"; | 30 | "or stdin to stdout. (i.e. 'dutmp /var/run/utmp')\n"; |
@@ -45,8 +51,8 @@ extern int dutmp_main(int argc, char **argv) | |||
45 | ut.ut_type, ut.ut_pid, ut.ut_line, | 51 | ut.ut_type, ut.ut_pid, ut.ut_line, |
46 | ut.ut_id, ut.ut_user, ut.ut_host, | 52 | ut.ut_id, ut.ut_user, ut.ut_host, |
47 | ut.ut_exit.e_termination, ut.ut_exit.e_exit, | 53 | ut.ut_exit.e_termination, ut.ut_exit.e_exit, |
48 | ut.ut_session, | 54 | ut.ut_session, ut.ut_tv.tv_sec, ut.ut_tv.tv_usec, |
49 | ut.ut_tv.tv_sec, ut.ut_tv.tv_usec, ut.ut_addr); | 55 | ut.ut_addr_v6[0]); |
50 | } | 56 | } |
51 | 57 | ||
52 | exit(TRUE); | 58 | exit(TRUE); |