Author: dchagin
Date: Sat Feb 12 20:16:25 2011
New Revision: 218618
URL: http://svn.freebsd.org/changeset/base/218618

Log:
  Slightly rewrite linux_fork:
  
  1) Remove bogus error checking.
  2) A new process exit from kernel through fork_trampoline(),
     so remove bogus check.

Modified:
  head/sys/compat/linux/linux_fork.c

Modified: head/sys/compat/linux/linux_fork.c
==============================================================================
--- head/sys/compat/linux/linux_fork.c  Sat Feb 12 19:14:57 2011        
(r218617)
+++ head/sys/compat/linux/linux_fork.c  Sat Feb 12 20:16:25 2011        
(r218618)
@@ -67,13 +67,9 @@ linux_fork(struct thread *td, struct lin
        if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0)
                return (error);
 
-       if (error == 0) {
-               td->td_retval[0] = p2->p_pid;
-               td->td_retval[1] = 0;
-       }
+       td->td_retval[0] = p2->p_pid;
+       td->td_retval[1] = 0;
 
-       if (td->td_retval[1] == 1)
-               td->td_retval[0] = 0;
        error = linux_proc_init(td, td->td_retval[0], 0);
        if (error)
                return (error);
@@ -106,13 +102,10 @@ linux_vfork(struct thread *td, struct li
        /* Exclude RFPPWAIT */
        if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 
0)
                return (error);
-       if (error == 0) {
-               td->td_retval[0] = p2->p_pid;
-               td->td_retval[1] = 0;
-       }
-       /* Are we the child? */
-       if (td->td_retval[1] == 1)
-               td->td_retval[0] = 0;
+
+       td->td_retval[0] = p2->p_pid;
+       td->td_retval[1] = 0;
+
        error = linux_proc_init(td, td->td_retval[0], 0);
        if (error)
                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