diff options
author | dchagin <dchagin@FreeBSD.org> | 2011-02-12 20:16:25 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2011-02-12 20:16:25 +0000 |
commit | bd20f716213cd829daa7c3e26fbc1498991910a4 (patch) | |
tree | 61ccd06eed6a103ea3e0d569636e9e775e70949c /sys/compat/linux | |
parent | 9cf49ae03260ebf64a3f29ae83566b1a5efff444 (diff) | |
download | FreeBSD-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.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r-- | sys/compat/linux/linux_fork.c | 19 |
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); |