Revision: 22983 http://trac.macosforge.org/projects/launchd/changeset/22983 Author: zarzycki@apple.com Date: 2006-12-14 12:47:04 -0800 (Thu, 14 Dec 2006) Log Message: ----------- <rdar://problem/4833937> launchd hangs when KeepAlive.PathState doesn't exist Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-12-14 19:59:58 UTC (rev 22982) +++ trunk/launchd/src/launchd_core_logic.c 2006-12-14 20:47:04 UTC (rev 22983) @@ -377,6 +377,7 @@ void job_watch(job_t j) { + struct semaphoreitem *si; struct socketgroup *sg; struct machservice *ms; struct watchpath *wp; @@ -398,6 +399,13 @@ SLIST_FOREACH(ms, &j->machservices, sle) { job_assumes(j, runtime_add_mport(ms->port, NULL, 0) == KERN_SUCCESS); } + + SLIST_FOREACH(si, &j->semaphores, sle) { + if (si->why == PATH_EXISTS || si->why == PATH_MISSING) { + /* Maybe another job has the inverse path based semaphore as this job */ + jobmgr_dispatch_all_other_semaphores(root_jobmgr, j); + } + } } void @@ -2707,7 +2715,6 @@ struct machservice *ms; struct stat sb; bool good_exit = (WIFEXITED(j->last_exit_status) && WEXITSTATUS(j->last_exit_status) == 0); - bool dispatch_others = false; if (j->mgr->global_on_demand_cnt > 0) { return false; @@ -2765,16 +2772,10 @@ wanted_state ? "exists" : "is missing", si->what); return true; } - dispatch_others = true; break; } } - /* Maybe another job has the inverse path based semaphore as this job */ - if (dispatch_others) { - jobmgr_dispatch_all_other_semaphores(root_jobmgr, j); - } - return false; }
participants (1)
-
source_changes@macosforge.org