diff options
Diffstat (limited to 'usr.bin/lastcomm')
-rw-r--r-- | usr.bin/lastcomm/Makefile | 1 | ||||
-rw-r--r-- | usr.bin/lastcomm/lastcomm.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/lastcomm/Makefile b/usr.bin/lastcomm/Makefile index 13f0fe6..be75109 100644 --- a/usr.bin/lastcomm/Makefile +++ b/usr.bin/lastcomm/Makefile @@ -2,5 +2,6 @@ # $FreeBSD$ PROG= lastcomm +WARNS?= 6 .include <bsd.prog.mk> diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c index 386f94f..f53923f 100644 --- a/usr.bin/lastcomm/lastcomm.c +++ b/usr.bin/lastcomm/lastcomm.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include <ctype.h> #include <err.h> #include <fcntl.h> +#include <grp.h> #include <pwd.h> #include <stdbool.h> #include <stdio.h> @@ -139,9 +140,10 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (strcmp(acctfile, "-") == 0) + if (strcmp(acctfile, "-") == 0) { fp = stdin; - else { + size = sizeof(struct acct); /* Always one more to read. */ + } else { /* Open the file. */ if ((fp = fopen(acctfile, "r")) == NULL || fstat(fileno(fp), &sb)) |