summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_event.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index a9e42de..85ee24e 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -280,6 +280,13 @@ filt_proc(struct knote *kn, long hint)
}
/*
+ * Process will already be reported as gone.
+ * Do not report anything else, as the knote will be destroyed soon.
+ */
+ if (kn->kn_status & KN_DETACHED)
+ return (0);
+
+ /*
* process forked, and user wants to track the new process,
* so attach a new knote to it, and immediately report an
* event with the parent's pid.
OpenPOWER on IntegriCloud