Slightly rewrite linux_fork:

1) Remove bogus error checking.
2) A new process exit from kernel through fork_trampoline(),
   so remove bogus check.
This commit is contained in:
Dmitry Chagin 2011-02-12 20:16:25 +00:00
parent 9588e04dde
commit cfa57401b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218618

View File

@ -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);