Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2007 09:15:54 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 113819 for review
Message-ID:  <200702010915.l119FsM3044489@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113819

Change 113819 by rdivacky@rdivacky_witten on 2007/02/01 09:15:53

	Reparent all procs that are part of a threading group but not its leaders
	to init and SIGCHLD init to finish the zombies off. This fixes zombies
	left after opera's exit.
	
	Noticed by: Scott Robbins <scottro@nyc.rr.com>

Affected files ...

.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#29 edit

Differences ...

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

@@ -165,6 +165,17 @@
 
 	KASSERT(em != NULL, ("proc_exit: emuldata not found.\n"));
 
+	/* reparent all procs that are not a thread leader to initproc */
+	if (em->shared->group_pid != p->p_pid) {
+	   	sx_xlock(&proctree_lock);
+	   	wakeup(initproc);
+		PROC_LOCK(p);
+		proc_reparent(p, initproc);
+		p->p_sigparent = SIGCHLD;
+		PROC_UNLOCK(p);
+	   	sx_xunlock(&proctree_lock);
+	}
+
 	child_clear_tid = em->child_clear_tid;
 
 	EMUL_UNLOCK(&emul_lock);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702010915.l119FsM3044489>