Module Name:    src
Committed By:   dholland
Date:           Thu Mar 15 03:01:03 UTC 2012

Modified Files:
        src/usr.bin/last: want.c

Log Message:
When the wtmp file is empty, for the "wtmp[x] begins..." output, use
the last mod time of the wtmp file (in practice, the time it was last
rotated, which is when it begins) instead of the current time, which
wasn't ever particularly useful. PR 39444.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/last/want.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/last/want.c
diff -u src/usr.bin/last/want.c:1.15 src/usr.bin/last/want.c:1.16
--- src/usr.bin/last/want.c:1.15	Thu Mar 15 02:55:02 2012
+++ src/usr.bin/last/want.c	Thu Mar 15 03:01:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: want.c,v 1.15 2012/03/15 02:55:02 dholland Exp $	*/
+/*	$NetBSD: want.c,v 1.16 2012/03/15 03:01:03 dholland Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -131,7 +131,7 @@ wtmp(const char *file, int namesz, int l
 	if (!S_ISREG(stb.st_mode))
 		errx(EXIT_FAILURE, "%s: Not a regular file", file);
 
-	seentime = time(NULL);
+	seentime = stb.st_mtime;
 	(void)signal(SIGINT, onintr);
 	(void)signal(SIGQUIT, onintr);
 

Reply via email to