Changeset 1765 in MondoRescue for branches/2.2.5/mindi-busybox/miscutils/last.c
- Timestamp:
- Nov 4, 2007, 3:16:40 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mindi-busybox/miscutils/last.c
r821 r1765 5 5 * Copyright (C) 2003-2004 by Erik Andersen <andersen@codepoet.org> 6 6 * 7 * Licensed under the GPL v 2 or later, see the file LICENSE in this tarball.7 * Licensed under the GPL version 2, see the file LICENSE in this tarball. 8 8 */ 9 9 10 #include "busybox.h" 11 #include <sys/types.h> 12 #include <fcntl.h> 13 #include <unistd.h> 14 #include <stdlib.h> 10 #include "libbb.h" 15 11 #include <utmp.h> 16 #include <sys/stat.h>17 #include <errno.h>18 #include <string.h>19 #include <time.h>20 12 21 13 #ifndef SHUTDOWN_TIME … … 35 27 #endif 36 28 29 int last_main(int argc, char **argv); 37 30 int last_main(int argc, char **argv) 38 31 { … … 44 37 bb_show_usage(); 45 38 } 46 file = bb_xopen(bb_path_wtmp_file, O_RDONLY);39 file = xopen(bb_path_wtmp_file, O_RDONLY); 47 40 48 41 printf("%-10s %-14s %-18s %-12.12s %s\n", "USER", "TTY", "HOST", "LOGIN", "TIME"); … … 53 46 } 54 47 55 if ( strncmp(ut.ut_line, "~", 1) == 0) {48 if (ut.ut_line[0] == '~') { 56 49 if (strncmp(ut.ut_user, "shutdown", 8) == 0) 57 50 ut.ut_type = SHUTDOWN_TIME; … … 96 89 } 97 90 98 bb_fflush_stdout_and_exit(EXIT_SUCCESS);91 fflush_stdout_and_exit(EXIT_SUCCESS); 99 92 }
Note:
See TracChangeset
for help on using the changeset viewer.