summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2011-02-12 20:16:25 +0000
committerdchagin <dchagin@FreeBSD.org>2011-02-12 20:16:25 +0000
commitbd20f716213cd829daa7c3e26fbc1498991910a4 (patch)
tree61ccd06eed6a103ea3e0d569636e9e775e70949c
parent9cf49ae03260ebf64a3f29ae83566b1a5efff444 (diff)
downloadFreeBSD-src-bd20f716213cd829daa7c3e26fbc1498991910a4.zip
FreeBSD-src-bd20f716213cd829daa7c3e26fbc1498991910a4.tar.gz
Slightly rewrite linux_fork:
1) Remove bogus error checking. 2) A new process exit from kernel through fork_trampoline(), so remove bogus check.
-rw-r--r--sys/compat/linux/linux_fork.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c
index 465f07f..ce8f559 100644
--- a/sys/compat/linux/linux_fork.c
+++ b/sys/compat/linux/linux_fork.c
@@ -67,13 +67,9 @@ linux_fork(struct thread *td, struct linux_fork_args *args)
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 linux_vfork_args *args)
/* 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);
OpenPOWER on IntegriCloud