]> 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)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 25 Mar 2015 09:36:49 +0000 (10:36 +0100)
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 9682764f0ea2515653eb466f8925facd9e1fbbc6..4a165c2c1b8cfe6734ae9a666cc8ae15ce29c9ef 100644 (file)
@@ -638,7 +638,7 @@ static void process_wtmp_file(const struct last_control *ctl,
        /*
         * Fill in 'lastdate'
         */
-       lastdate = lastdown;
+       lastdate = lastrch = lastdown;
 
        /*
         * Install signal handlers