diff options
| author | dholland <dholland@NetBSD.org> | 2012-03-15 03:01:03 +0000 |
|---|---|---|
| committer | dholland <dholland@NetBSD.org> | 2012-03-15 03:01:03 +0000 |
| commit | 6dd4567f39b52c22c19252be17ea9cbcaf354025 (patch) | |
| tree | 9948f658cde5317931750d09153546780ca3b92b /usr.bin/last | |
| parent | beb919828738e9ec5fc2cda9824ade9a5a398a52 (diff) | |
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.
Diffstat (limited to 'usr.bin/last')
| -rw-r--r-- | usr.bin/last/want.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/last/want.c b/usr.bin/last/want.c index 885974e1510..079be55df33 100644 --- a/usr.bin/last/want.c +++ b/usr.bin/last/want.c @@ -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 linesz, int hostsz, int numeric) 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); |
