git: bd76586bb705 - main - fork_norfproc(): style
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 20 Aug 2022 17:34:50 UTC
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bd76586bb705d62549f6df7ae8cebf7db252db63 commit bd76586bb705d62549f6df7ae8cebf7db252db63 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2022-08-12 00:37:55 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-08-20 17:33:17 +0000 fork_norfproc(): style Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D36207 --- sys/kern/kern_fork.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index d7f737832824..434c5a6290fe 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -307,8 +307,8 @@ retry: 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 @@ again: } 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 @@ again: /* * Unshare file descriptors (from parent). */ - if (flags & RFFDG) { + if ((flags & RFFDG) != 0) { fdunshare(td); pdunshare(td); }