PERFORCE change 107886 for review
Roman Divacky
rdivacky at FreeBSD.org
Sat Oct 14 07:16:58 PDT 2006
http://perforce.freebsd.org/chv.cgi?CH=107886
Change 107886 by rdivacky at rdivacky_witten on 2006/10/14 14:16:03
Send the pdeath_signal only if parent is exiting. Previously we were
sending it for any proc_reparent() call.
Affected files ...
.. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#6 edit
.. //depot/projects/linuxolator/src/sys/kern/kern_exit.c#4 edit
Differences ...
==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#6 (text+ko) ====
@@ -310,7 +310,11 @@
if (__predict_true(p->p_sysent != &elf_linux_sysvec))
return;
- em = em_find(p, EMUL_UNLOCKED);
- psignal(p, em->pdeath_signal);
- EMUL_UNLOCK(&emul_lock);
+ /* do this only if the parent is exiting */
+ if (p->p_pptr->p_flags & P_WEXIT) {
+ em = em_find(p, EMUL_UNLOCKED);
+ if (em->pdeath_signal != 0)
+ psignal(p, em->pdeath_signal);
+ EMUL_UNLOCK(&emul_lock);
+ }
}
==== //depot/projects/linuxolator/src/sys/kern/kern_exit.c#4 (text+ko) ====
@@ -897,8 +897,10 @@
if (child->p_pptr == parent)
return;
+ /* we want to have old parent accessible via p_pptr */
+ EVENTHANDLER_INVOKE(reparent, child);
+
LIST_REMOVE(child, p_sibling);
LIST_INSERT_HEAD(&parent->p_children, child, p_sibling);
child->p_pptr = parent;
- EVENTHANDLER_INVOKE(reparent, child);
}
More information about the p4-projects
mailing list