Date: Mon, 6 Dec 2010 19:15:39 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216240 - head/sys/kern Message-ID: <201012061915.oB6JFdwD042299@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Mon Dec 6 19:15:38 2010 New Revision: 216240 URL: http://svn.freebsd.org/changeset/base/216240 Log: 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@ Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Mon Dec 6 19:12:51 2010 (r216239) +++ head/sys/kern/kern_fork.c Mon Dec 6 19:15:38 2010 (r216240) @@ -199,7 +199,10 @@ fork_norfproc(struct thread *td, int fla 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012061915.oB6JFdwD042299>