From 07216d15fc49d96eb42a634934ce48232ef57c1a Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 6 Jan 1998 21:15:41 +0000 Subject: [PATCH] Allow retval to be NULL, filling it in only if it was passed. --- sys/kern/kern_fork.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index e9039d5bf8d7..e1a37eb6133a 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_fork.c,v 1.35 1998/01/05 05:16:28 thorpej Exp $ */ +/* $NetBSD: kern_fork.c,v 1.36 1998/01/06 21:15:41 thorpej Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 @@ -315,7 +315,9 @@ again: * 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); }