summaryrefslogtreecommitdiffhomepage
path: root/miscutils
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-04-28 00:18:56 +0000
committerErik Andersen <andersen@codepoet.org>2000-04-28 00:18:56 +0000
commit4f3f757d56fbf420ea5030dcf7ea971b3da3ab47 (patch)
treed986e9bb9f03bf1f83465c274c35c0d58ed544e4 /miscutils
parent227a59b05d6df9b4be5990915646249d6f548822 (diff)
Latest and greatest. Some effort at libc5 (aiming towards newlib)
compatability. -Erik
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/dutmp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c
index 1629067a1..886d7880d 100644
--- a/miscutils/dutmp.c
+++ b/miscutils/dutmp.c
@@ -14,11 +14,17 @@
#include "internal.h"
#include <stdio.h>
#include <errno.h>
-#include <utmp.h>
#define BB_DECLARE_EXTERN
#define bb_need_io_error
#include "messages.c"
+#if defined(__GLIBC__)
+#include <utmp.h>
+#else
+#include <utmp-wrap.h>
+#define utmp new_utmp
+#endif
+
static const char dutmp_usage[] = "dutmp [FILE]\n\n"
"Dump utmp file format (pipe delimited) from FILE\n"
"or stdin to stdout. (i.e. 'dutmp /var/run/utmp')\n";
@@ -45,8 +51,8 @@ extern int dutmp_main(int argc, char **argv)
ut.ut_type, ut.ut_pid, ut.ut_line,
ut.ut_id, ut.ut_user, ut.ut_host,
ut.ut_exit.e_termination, ut.ut_exit.e_exit,
- ut.ut_session,
- ut.ut_tv.tv_sec, ut.ut_tv.tv_usec, ut.ut_addr);
+ ut.ut_session, ut.ut_tv.tv_sec, ut.ut_tv.tv_usec,
+ ut.ut_addr_v6[0]);
}
exit(TRUE);