Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Mar 2011 19:39:42 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r219195 - stable/8/sys/compat/linux
Message-ID:  <201103021939.p22Jdg3T042121@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Wed Mar  2 19:39:42 2011
New Revision: 219195
URL: http://svn.freebsd.org/changeset/base/219195

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

Modified:
  stable/8/sys/compat/linux/linux_fork.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_fork.c
==============================================================================
--- stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:38:13 2011	(r219194)
+++ stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:39:42 2011	(r219195)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103021939.p22Jdg3T042121>