]> git.ipfire.org Git - thirdparty/util-linux.git/commit
last, fix race when comparing time stamps
authorRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 24 Mar 2015 11:22:13 +0000 (12:22 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 29 Apr 2015 10:24:52 +0000 (12:24 +0200)
commitdcd5bc5ce5423e94d60656d23612dd893c1eae9d
treeade67f2c1afd45ad45ee3cc3e8f5ca205e07b0b2
parent96c76c7effc2e58fe9b7780510f6a5025234964c
last, fix race when comparing time stamps

It is just luck if two time() calls happen within the same
second. Introduced in 31d28e09.

Actually I don't like adding another global variable but this
way we avoid bigger refactoring. IMO it's questionable why
lastdate, lastdown, etc. are initialized with current time() at
all. It looks unsafe to print "still running" always when
logout_time = now.

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