aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDavid Malone <dwmalone@FreeBSD.org>2007-05-03 13:57:19 +0000
committerDavid Malone <dwmalone@FreeBSD.org>2007-05-03 13:57:19 +0000
commit61f31ed6cf30ff5b62cf1b3d7fb08c83e99c57ba (patch)
treec95717bb23fb127ec2170d1345f3b8b4a33c6894 /usr.bin
parentd7a1f74bec9e8eea966c475766ba48f6a30f81bb (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/lastcomm/Makefile1
-rw-r--r--usr.bin/lastcomm/lastcomm.c6
2 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/lastcomm/Makefile b/usr.bin/lastcomm/Makefile
index 13f0fe6df654..be75109790b7 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 386f94fd5096..f53923fcd05b 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))