From: Ruediger Meier Date: Tue, 24 Mar 2015 13:38:09 +0000 (+0100) Subject: last: fix first (current) runlevel line X-Git-Tag: v2.26.2~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96c76c7effc2e58fe9b7780510f6a5025234964c;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 3d9a62bee2..fa59aa08bf 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -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