[launchd-changes] [23664] branches/PR-5039559/launchd/src/launchd.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Aug 14 20:51:48 PDT 2008


Revision: 23664
          http://trac.macosforge.org/projects/launchd/changeset/23664
Author:   dsorresso at apple.com
Date:     2008-08-14 20:51:47 -0700 (Thu, 14 Aug 2008)
Log Message:
-----------
Changed error checking to use launchd_assumes() and therefore a less snarky error message. Still need to figure out what to do in the case of failure. Probably just exit.

Modified Paths:
--------------
    branches/PR-5039559/launchd/src/launchd.c

Modified: branches/PR-5039559/launchd/src/launchd.c
===================================================================
--- branches/PR-5039559/launchd/src/launchd.c	2008-08-15 02:20:45 UTC (rev 23663)
+++ branches/PR-5039559/launchd/src/launchd.c	2008-08-15 03:51:47 UTC (rev 23664)
@@ -168,18 +168,13 @@
 	}
 
 //#if TARGET_OS_EMBEDDED
-	if( getpid() == 1 ) {
+	if( pid1_magic ) {
 		/* Start the update thread -- rdar://problem/5039559 */
 		pthread_t t = NULL;
 		int freq = 30;
 		int err = pthread_create(&t, NULL, (void (*)(void *))update_thread, (void *)freq);
-		if( err != 0 ) {
-			/* If we hit this condition, there's something horribly wrong. 
-			 * We're the first process; we shouldn't be running out of threads or anything 
-			 * whacky like that.
-			 */
-			fprintf(stderr, "%s: Dude, your system is seriously messed up (%d - %s). I'm guessing you'll crash very soon.\n", getprogname(), err, strerror(err));
-		}		
+		launchd_assumes(err == 0);
+		/* FIXME: Figure out what to do if we fail ... */
 	}
 //#endif
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080814/a77c52dc/attachment-0001.html 


More information about the launchd-changes mailing list