From dbe26095102cbdc6d5bef3509f05bc7b42c418cc Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 15 Jan 2013 12:09:21 -0800 Subject: SpawnProcess: improve dummy pipe allocation logic By using allocated file descriptors for keys in fd_pipes, we naturally avoid interference with callers such as FileDigester and MergeProcess. See the _setup_pipes docstring for more benefits of this allocation approach. --- bin/ebuild.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 80bdd8001..a4be7c067 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}" @@ -713,7 +713,10 @@ else ( # Don't allow subprocesses to inherit the pipe which # emerge uses to monitor ebuild.sh. - exec 9>&- + if [[ -n ${PORTAGE_PIPE_FD} ]] ; then + eval "exec ${PORTAGE_PIPE_FD}>&-" + unset PORTAGE_PIPE_FD + fi __ebuild_main ${EBUILD_SH_ARGS} exit 0 ) -- cgit v1.2.3-1-g7c22