[Pkg-sysvinit-commits] r1412 - in sysvinit-upstream/trunk: doc src

Petter Reinholdtsen pere at alioth.debian.org
Fri Jul 10 19:31:31 UTC 2009


Author: pere
Date: 2009-07-10 19:31:30 +0000 (Fri, 10 Jul 2009)
New Revision: 1412

Modified:
   sysvinit-upstream/trunk/doc/Changelog
   sysvinit-upstream/trunk/src/last.c
Log:
Adjust output from "last -x".  In reboot lines, print endpoint
of uptime too.  In shutdown lines print downtimes rather than
the time between downs.  Fix typo in string compare in last.c.
Patch by Thomas Hood.


Modified: sysvinit-upstream/trunk/doc/Changelog
===================================================================
--- sysvinit-upstream/trunk/doc/Changelog	2009-07-10 19:09:29 UTC (rev 1411)
+++ sysvinit-upstream/trunk/doc/Changelog	2009-07-10 19:31:30 UTC (rev 1412)
@@ -6,6 +6,10 @@
   * Update address of FSF in the COPYRIGHT file.
   * Document in halt(8) that -n might not disable all syncing.
     Patch by Bill Nottingham and Fedora
+  * Adjust output from "last -x".  In reboot lines, print endpoint
+    of uptime too.  In shutdown lines print downtimes rather than
+    the time between downs.  Fix typo in string compare in last.c.
+    Patch by Thomas Hood.
 
  -- Petter Reinholdtsen <pere at debian.org>  Fri, 30 Jul 2004 14:14:58 +0200
 

Modified: sysvinit-upstream/trunk/src/last.c
===================================================================
--- sysvinit-upstream/trunk/src/last.c	2009-07-10 19:09:29 UTC (rev 1411)
+++ sysvinit-upstream/trunk/src/last.c	2009-07-10 19:31:30 UTC (rev 1412)
@@ -418,7 +418,6 @@
 			sprintf(length, "- no logout");
 			break;
 		case R_REBOOT:
-			logouttime[0] = 0;      /* Print machine uptime */
 			break;
 		case R_TIMECHANGE:
 			logouttime[0] = 0;
@@ -717,7 +716,7 @@
 			ut.ut_type = SHUTDOWN_TIME;
 		else if (strncmp(ut.ut_user, "reboot", 6) == 0)
 			ut.ut_type = BOOT_TIME;
-		else if (strncmp(ut.ut_user, "runlevel", 7) == 0)
+		else if (strncmp(ut.ut_user, "runlevel", 8) == 0)
 			ut.ut_type = RUN_LVL;
 	}
 #if 1 /*def COMPAT*/
@@ -752,7 +751,7 @@
 		case SHUTDOWN_TIME:
 			if (extended) {
 				strcpy(ut.ut_line, "system down");
-				quit = list(&ut, lastdown, R_NORMAL);
+				quit = list(&ut, lastboot, R_NORMAL);
 			}
 			lastdown = lastrch = ut.ut_time;
 			down = 1;
@@ -769,6 +768,7 @@
 		case BOOT_TIME:
 			strcpy(ut.ut_line, "system boot");
 			quit = list(&ut, lastdown, R_REBOOT);
+			lastboot = ut.ut_time;
 			down = 1;
 			break;
 		case RUN_LVL:




More information about the Pkg-sysvinit-commits mailing list