Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/miscutils/last.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/miscutils/last.c
r3232 r3621 33 33 #if defined UT_LINESIZE \ 34 34 && ((UT_LINESIZE != 32) || (UT_NAMESIZE != 32) || (UT_HOSTSIZE != 256)) 35 #error struct utmp member char[] size(s) have changed!35 #error struct utmpx member char[] size(s) have changed! 36 36 #elif defined __UT_LINESIZE \ 37 && ((__UT_LINESIZE != 32) || (__UT_NAMESIZE != 64) || (__UT_HOSTSIZE != 256)) 38 #error struct utmp member char[] size(s) have changed! 37 && ((__UT_LINESIZE != 32) || (__UT_NAMESIZE != 32) || (__UT_HOSTSIZE != 256)) 38 /* __UT_NAMESIZE was checked with 64 above, but glibc-2.11 definitely uses 32! */ 39 #error struct utmpx member char[] size(s) have changed! 39 40 #endif 40 41 41 42 #if EMPTY != 0 || RUN_LVL != 1 || BOOT_TIME != 2 || NEW_TIME != 3 || \ 42 43 OLD_TIME != 4 43 #error Values for the ut_type field of struct utmp changed44 #error Values for the ut_type field of struct utmpx changed 44 45 #endif 45 46 … … 47 48 int last_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) 48 49 { 49 struct utmp ut;50 struct utmpx ut; 50 51 int n, file = STDIN_FILENO; 51 52 time_t t_tmp; … … 88 89 ut.ut_type = n != 3 ? n : SHUTDOWN_TIME; 89 90 #else 90 if ( strncmp(ut.ut_user, "shutdown", 8) == 0)91 if (is_prefixed_with(ut.ut_user, "shutdown")) 91 92 ut.ut_type = SHUTDOWN_TIME; 92 else if ( strncmp(ut.ut_user, "reboot", 6) == 0)93 else if (is_prefixed_with(ut.ut_user, "reboot")) 93 94 ut.ut_type = BOOT_TIME; 94 else if ( strncmp(ut.ut_user, "runlevel", 8) == 0)95 else if (is_prefixed_with(ut.ut_user, "runlevel")) 95 96 ut.ut_type = RUN_LVL; 96 97 #endif
Note:
See TracChangeset
for help on using the changeset viewer.