Properly initialize the timestamp when using ac -w.
When using ac -w, we must use the last timestamp to terminate the log file. I accidentally removed this when I ported the code to use utmpx. Reported by: avg
This commit is contained in:
parent
0bc7bd67ca
commit
9c8d0b9600
@ -583,10 +583,11 @@ ac(const char *file)
|
||||
endutxent();
|
||||
if (!(Flags & AC_W))
|
||||
usht.ut_tv.tv_sec = time(NULL);
|
||||
else
|
||||
usht.ut_tv.tv_sec = ut_timecopy;;
|
||||
usht.ut_type = SHUTDOWN_TIME;
|
||||
|
||||
if (Flags & AC_D) {
|
||||
ut_timecopy = usht.ut_tv.tv_sec;
|
||||
ltm = localtime(&ut_timecopy);
|
||||
if (day >= 0 && day != ltm->tm_yday) {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user