From nobody Tue May 03 14:06:32 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 1D9D41ABBC1D; Tue, 3 May 2022 14:06:33 +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 4Kt1wS6wFtz3j8b; Tue, 3 May 2022 14:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651586793; 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=QLonO5YjKLPDY3ifCDggtF5n4dn38zb/wpThTE89jkA=; b=nHskWoieeeRtIHniSuir29/IIb85AeDEJAHS6hTrFaclIZhTjHMDcFG9kXR5H5pRA8PgwK 7Efzqf/bQb1kHjemi+KvATndTork7dqfXGvQXmakp1/kjEqjcETuJxoaQcCZr0x/feZ9Gv 9xjYmffgCFNPGzaYmM5fONs3ZuUgD0OYsLsllAfrMRoK53UcVms0ISm9reJoK4brm1XeDz w+lWHLCFOyHb/yrjYM25a4kv4Lk8zJsVc1HuYa88zZoF4gzfIbXsyQW+TDRg6HDcR6lRVW 8SP06QZ+RD+dHrOLotzG18Xb/TWQhJNzVQ8MUmBqe5wmTo2u7iz1KSYjnfZLgA== 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 CAB8E1F662; Tue, 3 May 2022 14:06:32 +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 243E6WQo078280; Tue, 3 May 2022 14:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 243E6WIb078279; Tue, 3 May 2022 14:06:32 GMT (envelope-from git) Date: Tue, 3 May 2022 14:06:32 GMT Message-Id: <202205031406.243E6WIb078279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 1f7746d81f53 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 1f7746d81f53447ac15cc99395bb714d4dd0a4da Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651586793; 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=QLonO5YjKLPDY3ifCDggtF5n4dn38zb/wpThTE89jkA=; b=jj2VHrKopCqI0E6U7/v2CVbVjKX1t0kq5irZgJghM/OvZdwyWwab3XIiX9GV65SKHNemVT MeL1/OmNMmkZIRFj63ZHdJvHFgnRdtQSm9FPFAaPe5ZRrzNfDhwJ9m4n0gxKxwOHHYmI/u zmUnAZjxxyPSBfFxrVMZeM8vBLvAY7UeGZOSJjlIAgRTKuX+XryjNMj+AFRMT0Lld2HY0f TwFHx3p9Q7llmICVyCF4sb6GczLkAAk235rjYMLmGoFYWGrcwY16BT0zcZ0LpmzgsyZWzi IqA3h9EZ9sHBYyE5WCRtzW2Xr16RhnRK2wkQv5EYG+ZOhWbmb6/VH36qLKUoLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651586793; a=rsa-sha256; cv=none; b=gGlSBmRZMuQldClDPv2ibKbDECDUPmC4Cldn+AQ49BJ+NIFSUAYdo/CTAXGSUXKy+gHoOu MVIEtsh8ouN6yihkJraoG5Y3NcFDnjdLBx0zQH+NdeqAKVjDjPfYv38+fexeASw5iJDqHx IKMPsj35PNWrnc5OSBEk2/z0Nv6PPTdZ68eC27zwoBkbA0Z2VPq03dznlSnmtr3NnZ4pRH alzd/xGGIxNZTh/dn/cpSfVWpbB6WzZMyLMw5C3iWSICLEr1phosQjqdm8a+Wal3YxSclC bcoZh0vwxHFkSxa7pnjShHTe12LqD8eH8X3s3xfdI07GsWrd0d1Q2jxX6+nP7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1f7746d81f53447ac15cc99395bb714d4dd0a4da commit 1f7746d81f53447ac15cc99395bb714d4dd0a4da Author: Corvin Köhne AuthorDate: 2022-05-03 14:00:09 +0000 Commit: Emmanuel Vadot CommitDate: 2022-05-03 14:02:27 +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 --- 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