summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-06-05 22:38:41 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-06-05 22:38:41 +0000
commitc595e61fd42358e9f716f442ba8e764293f6823c (patch)
treee9eca28194f829296f22ef66b33f64668dfb7196 /sys/kern
parent84f01d49ea709a2ab7f5786ba93556a6c1704a6e (diff)
retval may be NULL in fork1, take 2
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_fork.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index a3b887a9ca9..becb63288a8 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.66 2004/05/24 02:51:22 deraadt Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.67 2004/06/05 22:38:40 tedu Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -371,8 +371,10 @@ fork1(struct proc *p1, int exitsig, int flags, void *stack, size_t stacksize,
* Return child pid to parent process,
* marking us as parent via retval[1].
*/
- retval[0] = p2->p_pid;
- retval[1] = 0;
+ if (retval != NULL) {
+ retval[0] = p2->p_pid;
+ retval[1] = 0;
+ }
return (0);
}