Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Apr 2010 14:30:56 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r206095 - head/usr.sbin/ac
Message-ID:  <201004021430.o32EUuXc083888@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Fri Apr  2 14:30:56 2010
New Revision: 206095
URL: http://svn.freebsd.org/changeset/base/206095

Log:
  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

Modified:
  head/usr.sbin/ac/ac.c

Modified: head/usr.sbin/ac/ac.c
==============================================================================
--- head/usr.sbin/ac/ac.c	Fri Apr  2 14:03:43 2010	(r206094)
+++ head/usr.sbin/ac/ac.c	Fri Apr  2 14:30:56 2010	(r206095)
@@ -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) {
 			/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004021430.o32EUuXc083888>