]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
last: fix first (current) runlevel line
authorRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 24 Mar 2015 13:38:09 +0000 (14:38 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 29 Apr 2015 10:24:34 +0000 (12:24 +0200)
Since 744c7fec lastrch was not set to current time anymore, but we need it.

 # broken:
 $ ./last -x | grep -m 2 runlevel
 runlevel (to lvl 5)   3.11.10-25-deskt Wed Feb 18 13:11 - 01:00 (-16484+-12:-11)
 runlevel (to lvl 5)   3.11.10-25-deskt Thu Jan 22 16:50 - 13:11 (26+20:21)

 # fixed:
 $ ./last -x | grep -m 2 runlevel
 runlevel (to lvl 5)   3.11.10-25-deskt Wed Feb 18 13:11   still running
 runlevel (to lvl 5)   3.11.10-25-deskt Thu Jan 22 16:50 - 13:11 (26+20:21)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
login-utils/last.c

index 3d9a62bee2171d1b60ddf7b7e5a974c1395ec59f..fa59aa08bf05928d5c1dd7fba0c201b82196046d 100644 (file)
@@ -646,7 +646,7 @@ static void process_wtmp_file(const struct last_control *ctl)
        /*
         * Fill in 'lastdate'
         */
-       lastdate = lastdown;
+       lastdate = lastrch = lastdown;
 
        /*
         * Install signal handlers