From: Ruediger Meier Date: Tue, 24 Mar 2015 13:38:09 +0000 (+0100) Subject: last: fix first (current) runlevel line X-Git-Tag: v2.27-rc1~281^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=568f460ca3c4ca1fff0c2c7e325a1b709992188c;p=thirdparty%2Futil-linux.git last: fix first (current) runlevel line 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 --- diff --git a/login-utils/last.c b/login-utils/last.c index 9682764f0e..4a165c2c1b 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -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