From nobody Tue Aug 23 00:29:42 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MBVVG479Yz4b4Lg; Tue, 23 Aug 2022 00:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MBVVG3Xqlz43Ql; Tue, 23 Aug 2022 00:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661214582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Pn6sQKTO9lab1V5rf7pAnGyO9xVNW6fWNCVF/CzdFA=; b=wDK/U1ff8YvMz5lDK2cL2xHBflQjmOs82honJLAJIBI0RV08OloiWi6tlY5OtW19JglJlh 2iuvEYvkGjv5xyGCH8h5BwXtOJ+pQxlifNyvhmojOtiZ+01R8966yXOp69THKew/iGi3M1 eCjE6UVHrCSYsFtSEvEgEG/XBsB19yzWet946y4uF7G8NHVwwJvfECaNse6XUJvQXAcTBD Ym61uw7s7vmQGSj77ZTE8w7lYlFGdlUL9bgNc2KSmdoRaTYSgGHXER7mAle05ZM71BST+s dUqg4E0ae2u8AEJ+t+F/e8Y3/lsuY2y7Ohv4XD3fJtIx3J4p9abLTnf+e8eJng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MBVVG2TpCz18WP; Tue, 23 Aug 2022 00:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27N0TgLk032472; Tue, 23 Aug 2022 00:29:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27N0TgIC032471; Tue, 23 Aug 2022 00:29:42 GMT (envelope-from git) Date: Tue, 23 Aug 2022 00:29:42 GMT Message-Id: <202208230029.27N0TgIC032471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 838c1fa88d71 - stable/13 - fork_norfproc(): style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 838c1fa88d71b61de86e37eac0b193a5eed21abe Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661214582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Pn6sQKTO9lab1V5rf7pAnGyO9xVNW6fWNCVF/CzdFA=; b=aeBSjabsvXzzNIy2I1Pymlh5ERJtjYmMsc0bo3biV9VbHYs1xGxjvjIwcPEsAFHB1SF70+ pU89fvoeOL2WzmT39ADjieykEx+odlJM2QyEi7K+c/l2ksuO1SxBBmQQvFjBr/GbL3TcFA DsuzzlMDkMBEvdCzcJ92KaClD+IUfJc2vH+71DV4pduygGe6TG/dtTZ3zWQpFlUKaeHaDv 9s6s5jbTLGggJ/vyNtB/yCIvY4NvJY5ssjD/HBx3nGrJd+aSu4WALdF/gqNoQZtVg1q4Xb /wKy0d8bROVtD0+uYjdL5HdEEtHsoW3o2LnTKPl01bpgqj2taRsdWttX9xmBEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661214582; a=rsa-sha256; cv=none; b=EyVnelikjN8uv3tHWJyA55BuT0u1uGV8xdGMyQUdClU52eiVKLis2oXjiyfqpkwlE7P00i R4R2O29JAPA5tkZ/1ZLAVljZH44R1UbH+oK8v7RBymfEN1X7OT/BMhSOErCqtr8ZFNgT81 MQlZwd8iQW9iZOr3l+82kiqJ/7pi/uvWdrRSs+kItgpUgs6BnIf1lZV2Ycw6qmlvEQ7BdP J/3yKlubUFQy/k7oucxd+PsQcHiMkK/FpQXiDwZGTe5LoqOU8I19J3IWnaVVzhOW0lWvZu ZrfIGa9aK+1JHQRcYSpl13ZQI04BISvJ+jyisYvrRJwGI7vw9upSB0BHWJ/ocw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=838c1fa88d71b61de86e37eac0b193a5eed21abe commit 838c1fa88d71b61de86e37eac0b193a5eed21abe Author: Konstantin Belousov AuthorDate: 2022-08-12 00:37:55 +0000 Commit: Konstantin Belousov CommitDate: 2022-08-22 13:37:09 +0000 fork_norfproc(): style (cherry picked from commit bd76586bb705d62549f6df7ae8cebf7db252db63) --- 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 90fc027b2979..ae716fb056a6 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -306,8 +306,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")); @@ -339,15 +339,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(td->td_proc->p_fd, false, NULL); pdescfree(td); @@ -359,7 +360,7 @@ again: /* * Unshare file descriptors (from parent). */ - if (flags & RFFDG) { + if ((flags & RFFDG) != 0) { fdunshare(td); pdunshare(td); }