diff options
author | ed <ed@FreeBSD.org> | 2010-04-02 14:30:56 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2010-04-02 14:30:56 +0000 |
commit | c65335fc919d64806cca03d40485891ca2bbc851 (patch) | |
tree | dc73fdcb84035e89cfe507f84f48296f1a65dba1 /usr.sbin/ac | |
parent | dbbce00a3360e9b0d40b149fbf1fda158661af6c (diff) | |
download | FreeBSD-src-c65335fc919d64806cca03d40485891ca2bbc851.zip FreeBSD-src-c65335fc919d64806cca03d40485891ca2bbc851.tar.gz |
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
Diffstat (limited to 'usr.sbin/ac')
-rw-r--r-- | usr.sbin/ac/ac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/ac/ac.c b/usr.sbin/ac/ac.c index d6db2d8..c584cd4 100644 --- a/usr.sbin/ac/ac.c +++ b/usr.sbin/ac/ac.c @@ -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) { /* |