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);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to