]> 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)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 25 Mar 2015 09:36:52 +0000 (10:36 +0100)
commit2e81d99870920a8f9a79a00221839ce8c8cb3400
treec4808b6ebecac8a311d280f94959267d3dd3538d
parent568f460ca3c4ca1fff0c2c7e325a1b709992188c
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