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@
This commit is contained in:
Edward Tomasz Napierala 2010-12-06 19:15:38 +00:00
parent dfc0276185
commit 087bfb0e6b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216240

View File

@ -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 @@ fork_norfproc(struct thread *td, int flags, struct proc **procp)
thread_single_end();
PROC_UNLOCK(p1);
}
*procp = NULL;
return (error);
}