Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/last When the wtmp file is empty, for the "wtmp[x] b...



details:   https://anonhg.NetBSD.org/src/rev/db4436f194d5
branches:  trunk
changeset: 778068:db4436f194d5
user:      dholland <dholland%NetBSD.org@localhost>
date:      Thu Mar 15 03:01:03 2012 +0000

description:
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:

 usr.bin/last/want.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 2068d92273e1 -r db4436f194d5 usr.bin/last/want.c
--- a/usr.bin/last/want.c       Thu Mar 15 02:55:02 2012 +0000
+++ b/usr.bin/last/want.c       Thu Mar 15 03:01:03 2012 +0000
@@ -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 @@
        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);
 



Home | Main Index | Thread Index | Old Index