PERFORCE change 109125 for review

Roman Divacky rdivacky at FreeBSD.org
Fri Nov 3 14:59:22 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=109125

Change 109125 by rdivacky at rdivacky_witten on 2006/11/03 14:59:09

	Pretend being a child of init in a case your parent based on em->shared->group_pid
	is not found. This is a temporary fix and better solution is on its way.

Affected files ...

.. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#27 edit

Differences ...

==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#27 (text+ko) ====

@@ -1443,7 +1443,15 @@
 	/* find the group leader */
 	p = pfind(em->shared->group_pid);
 
-	KASSERT(p != NULL, ("getppid: parent process not found.\n"));
+ 	/* lets pretend we were reparented to init */
+ 	if (p == NULL) {
+#ifdef DEBUG
+	   	printf("getppid: thread group leader not found.\n");
+#endif
+ 		td->td_retval[0] = 1;
+ 		EMUL_UNLOCK(&emul_lock);
+ 		return (0);
+       }
 
 	pp = p->p_pptr;		/* switch to parent */
 	PROC_LOCK(pp);


More information about the p4-projects mailing list