From nobody Thu Feb 16 03:34:51 2023 X-Original-To: dev-commits-src-branches@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 4PHLDD0PnXz3s0Zc; Thu, 16 Feb 2023 03:34:52 +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 4PHLDC74tPz4MC9; Thu, 16 Feb 2023 03: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=1676518492; 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=lP5GbwOUaxzOVTj2hZEOmnnwp+d5twQQ0mGWwc5o5A4=; b=h1r+/7EpvuTELhwrviXhHQMa/nitzeYIiQF3HmcmN2JdeQiCfO/+KAKRDZzyZbGedJ2AFb 9cQ+6ioJhwG9i+ED6QZL3qUmyB2WrPAHAcFTJGyboFpRg7qgEDkTGW7j9wcjrLTx8Y4vun SZp4UMHRjvhZRVet96QNVPmDVeZtwJMrjqwExQPkWaHVpc2ULTnAx79Nn0uEKUufpVqreO LOZNY4V+EXUi9qOtOzpxPlw7pkxn/bi3ds6MARTMGlFUqz67Tc3o+LvUbRa4/w9pYN77IW Klrqa9PSfYeBFhJcDV/SIvP4vUAI0b1i4AQJnTiGz4uHrOrlU2eWulJN/s2EsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676518492; 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=lP5GbwOUaxzOVTj2hZEOmnnwp+d5twQQ0mGWwc5o5A4=; b=aPQcdLaUMAqmrk1bO5UCiICxJ6PTvMuuDkZepYSs3lop+D45R+4a5jmd/PvWBmKopcRAsf xwf1YIMBJI4tL3AVqLzPHPx67sSryhL61XWso9SoAEV0Sqq6Hpc143yOkqnJXpuMZeWhES 48pYsGp2zzc17DgLn+Nxq7nNBH1iL9veODb2SKpcy/vEj3IqIah8tbEj0/q8cFm530o82R xmXUIDZ4rqJai4Lvk/5/hqTOZj6137nLVGSjZdwYZBJ7Yt5aBZcrBAVOXPz4M2gYRQ1fr1 4/IvnVJd8us7B34KtkAWIyzr1wQwWMcWese424ycEo2daoRNAJV+TpmFEqxFWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676518492; a=rsa-sha256; cv=none; b=Qq05io/L8DdH1sGqff+gF/aKpfRo+SSkvZ/rNGin7pTy8pu/bG0SMuEtxy20UJ4tnomNbK htdGqfJH77ft9iabcjzCFX+iuR53MYf8n4aUMaPhfUhC0lOxVw5cthu/vsNPwL8oqlCiuC VqDkcouvYZ0QPi05leueHGc6P3d0hVAygK2ed7vD9BkXFy4rCJbqPiwZ9QbsVhghoHWruT 1xLKCieV9sZUBcSmhcM/5JZ7VBQTRAVtzNi0b4ve5dQgqj5ZnyPh8/ZPmQO2IX2TNO5f3V cSow2wuHoWtThvLNRWWXoe1zjMAp0NjHdFcvsRXLrFC+CmiaHU7kEyDL2ipG9Q== 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 4PHLDC63hjzq3k; Thu, 16 Feb 2023 03:34:51 +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 31G3YpCW043029; Thu, 16 Feb 2023 03:34:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G3YpJv043028; Thu, 16 Feb 2023 03:34:51 GMT (envelope-from git) Date: Thu, 16 Feb 2023 03:34:51 GMT Message-Id: <202302160334.31G3YpJv043028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 786639d1950f - stable/13 - libc: popen: slightly simplify cloexec logic List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 786639d1950f369faf04fb6617d6ea85dae131a4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=786639d1950f369faf04fb6617d6ea85dae131a4 commit 786639d1950f369faf04fb6617d6ea85dae131a4 Author: Kyle Evans AuthorDate: 2023-02-13 06:33:52 +0000 Commit: Kyle Evans CommitDate: 2023-02-16 03:29:51 +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 (cherry picked from commit f123c6c425d4161b06f237996662496abbd78b94) --- 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); }