diff options
author | trasz <trasz@FreeBSD.org> | 2010-12-06 19:15:38 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2010-12-06 19:15:38 +0000 |
commit | 1d758da82069bb1c888419a3f4d7c9cb75112b6c (patch) | |
tree | 25b8c74e4ba644778fd28806cccbb4a6996ec25f /sys/kern | |
parent | e166421f4d8c003c78e787275ce850f880bbfc62 (diff) | |
download | FreeBSD-src-1d758da82069bb1c888419a3f4d7c9cb75112b6c.zip FreeBSD-src-1d758da82069bb1c888419a3f4d7c9cb75112b6c.tar.gz |
Add a KASSERT to make it obvious when fork_norfproc() is to be called,
and set *procp to NULL in all cases. Previously, it was not being set
in the ERESTART case. This is effectively no-op, since its value is
ignored by callers in the error case.
Reviewed by: kib@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_fork.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index e4b7378..19d7d0f 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -199,7 +199,10 @@ fork_norfproc(struct thread *td, int flags, struct proc **procp) int error; struct proc *p1; + KASSERT((flags & RFPROC) == 0, + ("fork_norfproc called with RFPROC set")); p1 = td->td_proc; + *procp = NULL; if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) && (flags & (RFCFDG | RFFDG))) { @@ -238,7 +241,6 @@ fail: thread_single_end(); PROC_UNLOCK(p1); } - *procp = NULL; return (error); } |