+ ++argv;
+ if ((argc == 2) && ((argv[0][0] != '-') || argv[0][1])) {
+ file = bb_xopen(*argv, O_RDONLY);
+ }
+
+
+ while ((n = safe_read(file, (void*)&ut, sizeof(struct utmp))) != 0) {
+
+ if (n != sizeof(struct utmp)) {
+ bb_perror_msg_and_die("short read");
+ }
+
+ /* Kludge around the fact that the binary format for utmp has changed. */
+#if __GNU_LIBRARY__ < 5
+ /* Linux libc5 */
+
+ bb_printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
+ ut.ut_type, ut.ut_pid, ut.ut_line,
+ ut.ut_id, ut.ut_user, ut.ut_host,
+ ctime(&(ut.ut_time)),
+ (long)ut.ut_addr);
+#else
+ /* Glibc, uClibc, etc. */