summaryrefslogtreecommitdiff
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2010-05-18 22:26:11 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2010-05-18 22:26:11 +0000
commit63ced9f75be635c48a84b1560d61e5454858d26d (patch)
treef6eab136e79f9de453f12ad7a440328a9578b2fc /sys/kern/kern_fork.c
parent0eebcf7d241b97d6a763d98b8cd5ee2dd7fe9ab6 (diff)
move knote list to struct process. ok guenther
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 df6ffd8c7a0..770174abe05 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.109 2010/03/24 23:18:17 tedu Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.110 2010/05/18 22:26:10 tedu Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -156,7 +156,7 @@ process_new(struct proc *newproc, struct proc *parentproc)
{
struct process *pr, *parent;
- pr = pool_get(&process_pool, PR_WAITOK);
+ pr = pool_get(&process_pool, PR_WAITOK | PR_ZERO);
pr->ps_mainproc = newproc;
TAILQ_INIT(&pr->ps_threads);
TAILQ_INSERT_TAIL(&pr->ps_threads, newproc, p_thr_link);
@@ -460,7 +460,8 @@ fork1(struct proc *p1, int exitsig, int flags, void *stack, size_t stacksize,
/*
* Notify any interested parties about the new process.
*/
- KNOTE(&p1->p_klist, NOTE_FORK | p2->p_pid);
+ if ((flags & FORK_THREAD) == 0)
+ KNOTE(&p1->p_p->ps_klist, NOTE_FORK | p2->p_pid);
/*
* Update stats now that we know the fork was successful.