Revision: 23664 http://trac.macosforge.org/projects/launchd/changeset/23664 Author: dsorresso@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
participants (1)
-
source_changes@macosforge.org