From owner-svn-src-all@FreeBSD.ORG Mon Dec 6 19:15:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 490E51065673; Mon, 6 Dec 2010 19:15:39 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 378D18FC1B; Mon, 6 Dec 2010 19:15:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB6JFdZP042301; Mon, 6 Dec 2010 19:15:39 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB6JFdwD042299; Mon, 6 Dec 2010 19:15:39 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012061915.oB6JFdwD042299@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 6 Dec 2010 19:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216240 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2010 19:15:39 -0000 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); }