summaryrefslogtreecommitdiff
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2001-10-24 01:05:39 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2001-10-24 01:05:39 +0000
commit79deba82cd9dd6ce50d7384bde40f2edb217ca82 (patch)
treeed7e8fddba779e6ae62cdf79fa92de3ef165b5f4 /sys/kern/kern_fork.c
parent3f498bf72b7dea1dfc10e65cc688301e07382031 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 592ff4412708..2d1ce60c31d8 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -585,10 +585,11 @@ again:
PROC_LOCK(p1);
#ifdef KTRACE
/*
- * Copy traceflag and tracefile if enabled.
- * If not inherited, these were zeroed above.
+ * Copy traceflag and tracefile if enabled. If not inherited,
+ * these were zeroed above but we still could have a trace race
+ * so make sure p2's p_tracep is NULL.
*/
- if (p1->p_traceflag & KTRFAC_INHERIT) {
+ if ((p1->p_traceflag & KTRFAC_INHERIT) && p2->p_tracep == NULL) {
p2->p_traceflag = p1->p_traceflag;
if ((p2->p_tracep = p1->p_tracep) != NULL) {
PROC_UNLOCK(p1);