fork_norfproc(): style
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D36207
This commit is contained in:
parent
6b598e263b
commit
bd76586bb7
@ -307,8 +307,8 @@ fork_findpid(int flags)
|
||||
static int
|
||||
fork_norfproc(struct thread *td, int flags)
|
||||
{
|
||||
int error;
|
||||
struct proc *p1;
|
||||
int error;
|
||||
|
||||
KASSERT((flags & RFPROC) == 0,
|
||||
("fork_norfproc called with RFPROC set"));
|
||||
@ -340,15 +340,16 @@ fork_norfproc(struct thread *td, int flags)
|
||||
}
|
||||
|
||||
error = vm_forkproc(td, NULL, NULL, NULL, flags);
|
||||
if (error)
|
||||
if (error != 0)
|
||||
goto fail;
|
||||
|
||||
/*
|
||||
* Close all file descriptors.
|
||||
*/
|
||||
if (flags & RFCFDG) {
|
||||
if ((flags & RFCFDG) != 0) {
|
||||
struct filedesc *fdtmp;
|
||||
struct pwddesc *pdtmp;
|
||||
|
||||
pdtmp = pdinit(td->td_proc->p_pd, false);
|
||||
fdtmp = fdinit();
|
||||
pdescfree(td);
|
||||
@ -360,7 +361,7 @@ fork_norfproc(struct thread *td, int flags)
|
||||
/*
|
||||
* Unshare file descriptors (from parent).
|
||||
*/
|
||||
if (flags & RFFDG) {
|
||||
if ((flags & RFFDG) != 0) {
|
||||
fdunshare(td);
|
||||
pdunshare(td);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user