From nobody Mon May 16 15:25:07 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 E7FD21AE3BF4; Mon, 16 May 2022 15:25:07 +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 4L23374wjPz3nqZ; Mon, 16 May 2022 15:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652714707; 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=DsouRtK8OYwrfNXadkkbHIAgUB5ZS5xir59lGPrIEug=; b=u5KI/PVs9CZmNY1PcBZYaU/EKN4Sn6Jx3rMK4WuxzrXaFT412b2jWQoTTkNegxyC2lZ6UR g4BQpApkVQFHeWns9ucRortIzTKAJ7OG8tAuXUuwMfLYgbkxu7XpXKZk79/7HJ4Oxe4zqw UrE4crujOQ+hUzvMmDGWtlSRXa3EeR/HJrF4WaCqyzCWtWebSkcMJojfT4+CbYv4anCXW6 NIgwyWHAQomNKRN0fKmQaCVP3/cHgn8Cxy7oLGcChjRi+CjYUSO9xDb95yGQK5kgBcv4pv SvBBBJX2jYEsUfgu+mFD7dEvuG8zo3z6r9NmEnrudoT+oC3Zgq3ngZIx6ew0OA== 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 83A0C22A94; Mon, 16 May 2022 15:25:07 +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 24GFP7R1006794; Mon, 16 May 2022 15:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24GFP7vI006793; Mon, 16 May 2022 15:25:07 GMT (envelope-from git) Date: Mon, 16 May 2022 15:25:07 GMT Message-Id: <202205161525.24GFP7vI006793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 45eb93a964e6 - stable/13 - bsdinstall: stop messing with file descriptors 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 45eb93a964e669dabb1d7f59dadac23c4238f878 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652714707; 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=DsouRtK8OYwrfNXadkkbHIAgUB5ZS5xir59lGPrIEug=; b=rVpztKk4pfhrTqLDoUv126rAur1vlWZJyhFVhHo2PwGZTb1gOn8IZfKCICLl+1yn7aUsX2 F23FWiGl04d73WbVrz9goup0vhcd3Ex9tWPrNhNm4o3lwpBFl0U0RCgfQ7N9f5qOKDZFve QdhXqI6cwHnCQwll4SgLqfDmG5V4eGWYzNvoCO8/7Z5oZafOPOg0go1KRQrRBPXuPh3WIa k5RbPqcDOI4jLLPsRP3K3w0ymFOdXEnYYIfdxTesD1J+zTm+0dy0qUSWciR6su4rjbZTb3 CelZcVWxUFOl+/pNK0q32sOb+ElOiFeHgh3qQ0M8DRJkmsn+p2ved4UNs++YeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652714707; a=rsa-sha256; cv=none; b=cw27Nku75+vOu3g/r8AL7b6U/wB0+b7sKkQ3pdbhOqp9wOz8wwGRx/gieC8t7SVVqKDdlC x+Lw6nOuMHCIyRpKuIPuykvrcpxJfaA/RV0UgxlUdDm8AssIv6pBT5aqI/UGO14Rn5MB4T dKOZ8/UG6WEZPgRj/A+t66RXk5rUTXAglWb01kPuDxeC29u+nkUHAXQaQe/tVUxTZckI8w Dqi9shqov/c/2vqxocIfGrfqPTYbl/REkD9baoV5mpbs8iKvXW4S3pvNSGBSJcBIfDjBfl Cs7ALLCQQUYkLTCqlFioxSE20aIsptYl3Qu5hb3GskZ9Fp6/gBiTJyXwjQb1+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=45eb93a964e669dabb1d7f59dadac23c4238f878 commit 45eb93a964e669dabb1d7f59dadac23c4238f878 Author: Corvin Köhne AuthorDate: 2022-05-03 14:00:09 +0000 Commit: Emmanuel Vadot CommitDate: 2022-05-16 15:24:56 +0000 bsdinstall: stop messing with file descriptors Throughout the bsdinstall script fd 3 is used by f_dprintf (set through $TERMINAL_STDOUT_PASSTHRU). By closing file descriptor 3 here, the final f_dprintf "Installation Completed ... does not work anymore. By putting the code into a subshell, file descriptors can be edited without interference with the calling script. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D35113 Sponsored by: Beckhoff Automation GmbH & Co. KG MFC after: 3 days (cherry picked from commit 1f7746d81f53447ac15cc99395bb714d4dd0a4da) --- usr.sbin/bsdinstall/scripts/script | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script index 8d9dd5205132..92332241f348 100755 --- a/usr.sbin/bsdinstall/scripts/script +++ b/usr.sbin/bsdinstall/scripts/script @@ -115,12 +115,13 @@ fi bsdinstall mount # Fetch missing distribution files, if any -exec 3>&1 -export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&3) -FETCH_RESULT=$? -exec 3>&- - -[ $FETCH_RESULT -ne 0 ] && error "Could not fetch remote distributions" +( + exec 3>&1 + export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&3) + FETCH_RESULT=$? + exec 3>&- + return $FETCH_RESULT +) || error "Could not fetch remote distributions" # Unpack distributions bsdinstall checksum