From nobody Sat Aug 20 17:34:50 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 4M95NW1SYrz4Zpgj; Sat, 20 Aug 2022 17:34:51 +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 4M95NW0z5Xz3X14; Sat, 20 Aug 2022 17:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661016891; 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=MlWyYfjYmSMfnXU55oy0ZbmDkt13vaYCvbtZlw9n8gs=; b=Ro/033af1h/TA6PIU4arAIqp8AZXlptU6tjgFIvA9ZZ3N8QLnMtPATErFVHA/UPx6KFaeM XNM8h3S07lTuunYVM1sk/vmC3uRnNHiUPza1mZ6hg8NzvIxFwux6zbGvkFhnMw/16U0BFv nSHpslEfxCTMSstb8IEsa0RXHzRgqoIhK3E++R5CJstSyf75yB/nHeTZjOMZix1QvIJsz8 O3hkopqSkkb6M7ti8RJIEofTPsvXMN+1G59qsibzvrCzM5F3j8CSjm2qH6Tz2S/OlDK3Du WRA/Tag+B3sn3ZuupHaBci4ecuXj3oKqFdSa9IMW3LfW+wrbH1rLAVMkoiOQQQ== 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 4M95NV72N3zgYj; Sat, 20 Aug 2022 17:34:50 +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 27KHYo9S093265; Sat, 20 Aug 2022 17:34:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27KHYoOn093264; Sat, 20 Aug 2022 17:34:50 GMT (envelope-from git) Date: Sat, 20 Aug 2022 17:34:50 GMT Message-Id: <202208201734.27KHYoOn093264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bd76586bb705 - main - 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/main X-Git-Reftype: branch X-Git-Commit: bd76586bb705d62549f6df7ae8cebf7db252db63 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661016891; 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=MlWyYfjYmSMfnXU55oy0ZbmDkt13vaYCvbtZlw9n8gs=; b=DVQ1TgrBY8f4ynpADIkEpG7k+WA72irslyNLyQ7gLBQ3tBur15UgW8oYLWJiLVivTeDyTV xHy9yKiglc0uVWMwltaVKJquyQuAWd7tAkTnyw9ctM2k51rqVA/rfmHtaytsgaQ/rEefel e+IacXIiaSHMK48d5Wd+pOXXGq3WKvFijCG2BE5t2cUNszr29ulf60T0RkD+YvRkmHLJei 4JbOlPmZI40c/fj1YjoWhCsSLXjRmIi6c/mSPKScDpmFRlDI//cUYQPcFHBtxYmQCQCKA4 y9eX+91/lpn/GAUN6vL/82n7mXf5HOWiTRC4qlIRtKqjsFcnM19G205WQz7CFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661016891; a=rsa-sha256; cv=none; b=ee7xjA9Uwq+B7o7/17ixlaqJy6kjgsqYIKWcV+KvQTsdaOXdiCD9JU3L+G7GaDOJDdfvNv NCSYDaH3zEMDehBKRpA9xJhixO9c6v9qEk4g8YAUjYtdnydKFQbvoVig6XwacIPmexSsVm Z7BzhsgaLvltCg8vLdGzSn8Yxb+1QgKOR262/kxwuAdCxcAtNobDgtCuVORftSdt+mEfhA tPNkdqLRrw1wAmL8EHBD7Z/3Lwie44mwQZkwHjuGHhdzvQdqyfd6p5HYgJgAmYystDcV6k bxiWEUwqAEbTmDhpAAyKAX7llZbbqjsIDp+1QaShfcidQJ/pGzm8tEE98dFXnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bd76586bb705d62549f6df7ae8cebf7db252db63 commit bd76586bb705d62549f6df7ae8cebf7db252db63 Author: Konstantin Belousov AuthorDate: 2022-08-12 00:37:55 +0000 Commit: Konstantin Belousov 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); }