diff options
author | Ed Schouten <ed@FreeBSD.org> | 2015-07-21 10:52:05 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2015-07-21 10:52:05 +0000 |
commit | 46e834d780565297c87e0c93003fbbd382e4655a (patch) | |
tree | 92645f7560c807cf267e845b419d3d6e734650e1 /usr.bin | |
parent | 94df6fad1df04f4b7be5e1cf7197a77bd0c2b98d (diff) | |
download | src-46e834d780565297c87e0c93003fbbd382e4655a.tar.gz src-46e834d780565297c87e0c93003fbbd382e4655a.zip |
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/last/last.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 945cc4119ee0..1db10b399dfa 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); typedef struct arg { char *name; /* argument */ +#define REBOOT_TYPE -1 #define HOST_TYPE -2 #define TTY_TYPE -3 #define USER_TYPE -4 @@ -180,6 +181,8 @@ main(int argc, char *argv[]) if (argc) { setlinebuf(stdout); for (argv += optind; *argv; ++argv) { + if (strcmp(*argv, "reboot") == 0) + addarg(REBOOT_TYPE, *argv); #define COMPATIBILITY #ifdef COMPATIBILITY /* code to allow "last p5" to work */ @@ -389,6 +392,11 @@ want(struct utmpx *bp) for (step = arglist; step; step = step->next) switch(step->type) { + case REBOOT_TYPE: + if (bp->ut_type == BOOT_TIME || + bp->ut_type == SHUTDOWN_TIME) + return (YES); + break; case HOST_TYPE: if (!strcasecmp(step->name, bp->ut_host)) return (YES); |