Revision
23950
Author
dsorresso@apple.com
Date
2009-11-17 16:24:45 -0800 (Tue, 17 Nov 2009)

Log Message

Another attempt.

Modified Paths

Diff

Modified: branches/PR-7264615/launchd/src/launchd_core_logic.c (23949 => 23950)


--- branches/PR-7264615/launchd/src/launchd_core_logic.c	2009-11-18 00:10:09 UTC (rev 23949)
+++ branches/PR-7264615/launchd/src/launchd_core_logic.c	2009-11-18 00:24:45 UTC (rev 23950)
@@ -1421,13 +1421,13 @@
 	 * See rdar://problem/7264615 for the symptom and rdar://problem/5020256
 	 * as to why this can happen.
 	 */
-	pid_t ppid = kp.kp_eproc.e_ppid;
-	if( !jobmgr_assumes(jm, ppid != anonpid) ) {
+	if( !jobmgr_assumes(jm, kp.kp_eproc.e_ppid != anonpid) ) {
 		jobmgr_log(jm, LOG_WARNING, "Process has become its own parent through ptrace(3). It should find a different way to do whatever it's doing. Setting PPID to 0: %s", kp.kp_proc.p_comm);
-		ppid = 0;
+		errno = EINVAL;
+		return NULL;
 	}
 
-	switch (ppid) {
+	switch (kp.kp_eproc.e_ppid) {
 	case 0:
 		/* the kernel */
 		break;