From nobody Mon Feb 13 06:34:03 2023 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 4PFZLM6TzRz3rDX2; Mon, 13 Feb 2023 06:34:03 +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 4PFZLM5mbbz4HwD; Mon, 13 Feb 2023 06:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676270043; 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=YqVBXBYsM7W0uGtvOeWWeR28A7hkzGhbbugulRnJ8qY=; b=vBWNZ/PV1pgzPRTx7eZV0Q5uj+aVr85T3SDkTJi8dQr31mJH4DLRw0BREV1JPbZT0764eH xUnU7GdgDxshSUQVTwmR7sV6+hJsSqG9CxffANEAxLFAclIPzJtgWrPsnrbrBJpt0/KXyv o2/3FYCsJ9dvuPM9mhGxDLMGh9PJii3geObRPNqLcrES4pqYSpjTlw2znjngaUkSthAMZo S2fSs0hGC8ObYGwIIzNfQpRtmYxpzIfgmaPkJnV0M3B9IlJtnvKt2OYF/BH8xS25SScFa9 Tz1or8UpN3GUewl4PwfHgjsxdDohRb4z/kVDma7K/LP6PXkr3fqKCwOdetGNCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676270043; 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=YqVBXBYsM7W0uGtvOeWWeR28A7hkzGhbbugulRnJ8qY=; b=B8uc8LZCZgud0BLW4QzdnM2FTOOnyi20ftWe1VpZUl/rIWEBXKPML05KxDV7zmCQGSET3Q R7RMfzVTJQmCmj/9woAtVTOk2Uo9sGCAramurXFf9/Qkzm8/iEb3V5+bbXHlCt3Vt5HjP6 hZEr2X4esgJ2FGQejXIjAu/BAbCIJ9W8pyVFLx6J2RTqnbO63AGi9bSGcU7d3SAY/YqzzJ l7fCpLe7CAhdVnF7TOMY+1Y1qKTZZI9aDytcIZjCu46XbosofoZZt1Xcjw2UrBepmXRrXN rTZ4HLJIBRm9vZzXMQyyDg1f4t6jpW5jvQeqXzCWuz9H7F5X0oX186/SFDy17w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676270043; a=rsa-sha256; cv=none; b=wV/wnwImNit44tunhjY2jIv9qi1NoeW7eAfwqmwmj1nkooQ1IGngXwTuIMGTlOpIF8jixI M12/TBRWr8qFoK4GS1FMNatsrJ1dGUTzJvs3yVwZPD/5OxM7DLdmM69sM9WWngR7sve6EC UA+GmsPpmfoGd1AXGR67Z/mTdCSAKhHjpKdPggHKSCFr1fOahuadjj2H+fUL1uc32PBrH1 8xdXHo/dDLFo7n0O007ZzCrtJeCwBEXoiZ+ApKqiKqoOJk7EhZtFlpyQ4w9ALriOEX2bf9 0nVla+4Kg6FlKuXr7e1xkyp1T1alnRwsnL/kqpREI7E+hFYrAaIObHfoWaeg2A== 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 4PFZLM4mZnz17tZ; Mon, 13 Feb 2023 06:34:03 +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 31D6Y3gg010341; Mon, 13 Feb 2023 06:34:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31D6Y3YI010340; Mon, 13 Feb 2023 06:34:03 GMT (envelope-from git) Date: Mon, 13 Feb 2023 06:34:03 GMT Message-Id: <202302130634.31D6Y3YI010340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: f123c6c425d4 - main - libc: popen: slightly simplify cloexec logic 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f123c6c425d4161b06f237996662496abbd78b94 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f123c6c425d4161b06f237996662496abbd78b94 commit f123c6c425d4161b06f237996662496abbd78b94 Author: Kyle Evans AuthorDate: 2023-02-13 06:33:52 +0000 Commit: Kyle Evans CommitDate: 2023-02-13 06:33:57 +0000 libc: popen: slightly simplify cloexec logic No need to check the mode again here; we know that `iop` wraps the correct fd. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D37987 --- lib/libc/gen/popen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index 4f94405c2ff4..c5373077f3ae 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -181,7 +181,7 @@ popen(const char *command, const char *type) * the list which will cause an explicit close. */ if (!cloexec) - (void)_fcntl(*type == 'r' ? pdes[0] : pdes[1], F_SETFD, 0); + (void)_fcntl(fileno(iop), F_SETFD, 0); return (iop); }