[launchd-changes] [23191] trunk/launchd/src/launchd_runtime.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Mar 29 15:22:28 PDT 2007


Revision: 23191
          http://trac.macosforge.org/projects/launchd/changeset/23191
Author:   zarzycki at apple.com
Date:     2007-03-29 15:22:28 -0700 (Thu, 29 Mar 2007)

Log Message:
-----------
Make the first log line delta zero.

Modified Paths:
--------------
    trunk/launchd/src/launchd_runtime.c

Modified: trunk/launchd/src/launchd_runtime.c
===================================================================
--- trunk/launchd/src/launchd_runtime.c	2007-03-29 21:38:00 UTC (rev 23190)
+++ trunk/launchd/src/launchd_runtime.c	2007-03-29 22:22:28 UTC (rev 23191)
@@ -1004,7 +1004,7 @@
 	static struct timeval shutdown_start;
 	static struct timeval prev_msg;
 	static int apple_internal_logging = 1;
-	struct timeval tvnow, tvd_total, tvd_msg_delta;
+	struct timeval tvnow, tvd_total, tvd_msg_delta = { 0, 0 };
 	struct stat sb;
 	int saved_errno = errno;
 	char newmsg[10000];
@@ -1053,8 +1053,11 @@
 	}
 
 	timersub(&tvnow, &shutdown_start, &tvd_total);
-	timersub(&tvnow, &prev_msg, &tvd_msg_delta);
 
+	if (prev_msg.tv_sec != 0) {
+		timersub(&tvnow, &prev_msg, &tvd_msg_delta);
+	}
+
 	prev_msg = tvnow;
 
 	snprintf(newmsg, sizeof(newmsg), "%3ld.%06d\t%ld.%06d\t",

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070329/55c05642/attachment.html


More information about the launchd-changes mailing list