summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-20 11:43:52 -0300
committerRenato Botelho <renato@netgate.com>2015-08-20 11:43:52 -0300
commit46a2fb2044d97438d3bb7b4a193c0f79682e8938 (patch)
treec3ee5352a97a12a78724498f129781c33a15c8a0 /usr.bin
parent7ddbda98a4f13c53da8b161b77dc5f00b4a02891 (diff)
parent33f4807b1fb49724cbe245b65052f21e4b0f67fb (diff)
downloadFreeBSD-src-46a2fb2044d97438d3bb7b4a193c0f79682e8938.zip
FreeBSD-src-46a2fb2044d97438d3bb7b4a193c0f79682e8938.tar.gz
Merge branch 'stable/10' into devel
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/last/last.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c
index 945cc41..1db10b3 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);
OpenPOWER on IntegriCloud