Page MenuHomeFreeBSD

D58327.diff
No OneTemporary

D58327.diff

diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c
--- a/sys/kern/sys_procdesc.c
+++ b/sys/kern/sys_procdesc.c
@@ -493,16 +493,25 @@
procdesc_kqops_event(struct knote *kn, long hint)
{
struct procdesc *pd;
+ struct proc *p;
u_int event;
pd = kn->kn_fp->f_data;
if (hint == 0) {
/*
* Initial test after registration. Generate notes in
- * case the process already terminated before registration.
+ * case the process already terminated before
+ * registration, or is stopped, or traced, with an event
+ * pending.
*/
- event = (pd->pd_flags & PDF_EXITED) != 0 ? (NOTE_EXIT |
- NOTE_PDSIGCHLD) : 0;
+ p = pd->pd_proc;
+ if ((pd->pd_flags & PDF_EXITED) != 0)
+ event = NOTE_EXIT | NOTE_PDSIGCHLD;
+ else if ((atomic_load_int(&p->p_flag) & (P_STOPPED_SIG |
+ P_STOPPED_TRACE)) != 0)
+ event = NOTE_PDSIGCHLD;
+ else
+ event = 0;
} else {
/* Mask off extra data. */
event = (u_int)hint & NOTE_PCTRLMASK;

File Metadata

Mime Type
text/plain
Expires
Fri, Jul 24, 7:07 AM (13 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35296987
Default Alt Text
D58327.diff (973 B)

Event Timeline