aboutsummaryrefslogtreecommitdiff
path: root/miscutils/dutmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/dutmp.c')
-rw-r--r--miscutils/dutmp.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c
index 113f850fe..86d7ce4b3 100644
--- a/miscutils/dutmp.c
+++ b/miscutils/dutmp.c
@@ -28,13 +28,9 @@
28 * Do what we can while still keeping this reasonably small. 28 * Do what we can while still keeping this reasonably small.
29 * Note: We are assuming the ut_id[] size is fixed at 4. */ 29 * Note: We are assuming the ut_id[] size is fixed at 4. */
30 30
31#if __GNU_LIBRARY__ < 5
32#warning the format string needs to be changed
33#else
34#if (UT_LINESIZE != 32) || (UT_NAMESIZE != 32) || (UT_HOSTSIZE != 256) 31#if (UT_LINESIZE != 32) || (UT_NAMESIZE != 32) || (UT_HOSTSIZE != 256)
35#error struct utmp member char[] size(s) have changed! 32#error struct utmp member char[] size(s) have changed!
36#endif 33#endif
37#endif
38 34
39extern int dutmp_main(int argc, char **argv) 35extern int dutmp_main(int argc, char **argv)
40{ 36{
@@ -57,18 +53,6 @@ extern int dutmp_main(int argc, char **argv)
57 bb_perror_msg_and_die("short read"); 53 bb_perror_msg_and_die("short read");
58 } 54 }
59 55
60 /* Kludge around the fact that the binary format for utmp has changed. */
61#if __GNU_LIBRARY__ < 5
62 /* Linux libc5 */
63
64 bb_printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
65 ut.ut_type, ut.ut_pid, ut.ut_line,
66 ut.ut_id, ut.ut_user, ut.ut_host,
67 ctime(&(ut.ut_time)),
68 (long)ut.ut_addr);
69#else
70 /* Glibc, uClibc, etc. */
71
72 bb_printf("%d|%d|%.32s|%.4s|%.32s|%.256s|%d|%d|%ld|%ld|%ld|%x\n", 56 bb_printf("%d|%d|%.32s|%.4s|%.32s|%.256s|%d|%d|%ld|%ld|%ld|%x\n",
73 ut.ut_type, ut.ut_pid, ut.ut_line, 57 ut.ut_type, ut.ut_pid, ut.ut_line,
74 ut.ut_id, ut.ut_user, ut.ut_host, 58 ut.ut_id, ut.ut_user, ut.ut_host,
@@ -76,7 +60,6 @@ extern int dutmp_main(int argc, char **argv)
76 ut.ut_session, 60 ut.ut_session,
77 ut.ut_tv.tv_sec, ut.ut_tv.tv_usec, 61 ut.ut_tv.tv_sec, ut.ut_tv.tv_usec,
78 ut.ut_addr); 62 ut.ut_addr);
79#endif
80 } 63 }
81 64
82 bb_fflush_stdout_and_exit(EXIT_SUCCESS); 65 bb_fflush_stdout_and_exit(EXIT_SUCCESS);