Revision: 23242 http://trac.macosforge.org/projects/launchd/changeset/23242 Author: zarzycki@apple.com Date: 2007-05-07 14:15:05 -0700 (Mon, 07 May 2007) Log Message: ----------- <rdar://problem/5179313> Log: launchd_core_logic.c:1986 (23240):2: (flags & EV_ONESHOT) Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2007-04-27 20:29:41 UTC (rev 23241) +++ trunk/launchd/src/launchd_core_logic.c 2007-05-07 21:15:05 UTC (rev 23242) @@ -997,12 +997,8 @@ } if (jobmgr_assumes(jm, (jr = job_new(jm, AUTO_PICK_LEGACY_LABEL, kp.kp_proc.p_comm, NULL)) != NULL)) { - u_int proc_fflags = NOTE_EXEC|NOTE_EXIT; + u_int proc_fflags = NOTE_EXEC|NOTE_EXIT|NOTE_REAP; -#ifdef NOTE_REAP - proc_fflags |= NOTE_REAP; -#endif - total_children++; jr->anonymous = true; jr->p = anonpid; @@ -1983,22 +1979,22 @@ } if (fflags & NOTE_EXIT) { - job_assumes(j, (flags & EV_ONESHOT)); - job_assumes(j, (flags & EV_EOF)); job_reap(j); if (j->anonymous) { job_remove(j); + j = NULL; } else { j = job_dispatch(j, false); } } -#ifdef NOTE_REAP if (j && (fflags & NOTE_REAP)) { + job_assumes(j, flags & EV_ONESHOT); + job_assumes(j, flags & EV_EOF); + job_assumes(j, j->p == 0); } -#endif } void @@ -2121,12 +2117,8 @@ pid_t c; bool sipc = false; time_t td; - u_int proc_fflags = /* NOTE_EXEC|NOTE_FORK| */ NOTE_EXIT; + u_int proc_fflags = /* NOTE_EXEC|NOTE_FORK| */ NOTE_EXIT|NOTE_REAP; -#ifdef NOTE_REAP - proc_fflags |= NOTE_REAP; -#endif - if (!job_assumes(j, j->mgr != NULL)) { return; }
participants (1)
-
source_changes@macosforge.org