diff options
author | Zac Medico <zmedico@gentoo.org> | 2013-01-15 12:09:21 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2013-01-15 12:09:21 -0800 |
commit | dbe26095102cbdc6d5bef3509f05bc7b42c418cc (patch) | |
tree | fbdc5d18ff9fa33dc7b69fdb6c173312cb4507a8 /bin/ebuild.sh | |
parent | 7c624515d0bb106c8a468addff5df153cebf31fc (diff) | |
download | portage-dbe26095102cbdc6d5bef3509f05bc7b42c418cc.tar.gz portage-dbe26095102cbdc6d5bef3509f05bc7b42c418cc.tar.bz2 portage-dbe26095102cbdc6d5bef3509f05bc7b42c418cc.zip |
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.
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-x | bin/ebuild.sh | 7 |
1 files changed, 5 insertions, 2 deletions
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 ) |