diff options
author | 2017-12-31 11:33:42 +0100 | |
---|---|---|
committer | 2018-01-04 22:56:35 +0100 | |
commit | 1606e3d1fa4eaa5fb4d799261e214b757bad9986 (patch) | |
tree | d3d6412cbb039df47f47fb68be53a5ec57617e0c /eclass/multiprocessing.eclass | |
parent | multiprocessing.eclass: Remove bashpid function (diff) | |
download | gentoo-1606e3d1fa4eaa5fb4d799261e214b757bad9986.tar.gz gentoo-1606e3d1fa4eaa5fb4d799261e214b757bad9986.tar.bz2 gentoo-1606e3d1fa4eaa5fb4d799261e214b757bad9986.zip |
multiprocesing.eclass: Remove redirect_alloc_fd
Remove the redirect_alloc_fd function that is no longer used since
the removal of multijob* functions. The function is complex, has little
potential use and an equivalent functionality is built-in in newer bash
versions, making it completely unnecessary for EAPI 6.
Closes: https://github.com/gentoo/gentoo/pull/6696
Diffstat (limited to 'eclass/multiprocessing.eclass')
-rw-r--r-- | eclass/multiprocessing.eclass | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.eclass index 6ca9b4fa7850..3e8b2f9d2540 100644 --- a/eclass/multiprocessing.eclass +++ b/eclass/multiprocessing.eclass @@ -100,39 +100,4 @@ makeopts_loadavg() { echo ${lavg:-${2:-999}} } -# @FUNCTION: redirect_alloc_fd -# @USAGE: <var> <file> [redirection] -# @DESCRIPTION: -# Find a free fd and redirect the specified file via it. Store the new -# fd in the specified variable. Useful for the cases where we don't care -# about the exact fd #. -redirect_alloc_fd() { - local var=$1 file=$2 redir=${3:-"<>"} - - # Make sure /dev/fd is sane on Linux hosts. #479656 - if [[ ! -L /dev/fd && ${CBUILD} == *linux* ]] ; then - eerror "You're missing a /dev/fd symlink to /proc/self/fd." - eerror "Please fix the symlink and check your boot scripts (udev/etc...)." - die "/dev/fd is broken" - fi - - if [[ $(( (BASH_VERSINFO[0] << 8) + BASH_VERSINFO[1] )) -ge $(( (4 << 8) + 1 )) ]] ; then - # Newer bash provides this functionality. - eval "exec {${var}}${redir}'${file}'" - else - # Need to provide the functionality ourselves. - local fd=10 - while :; do - # Make sure the fd isn't open. It could be a char device, - # or a symlink (possibly broken) to something else. - if [[ ! -e /dev/fd/${fd} ]] && [[ ! -L /dev/fd/${fd} ]] ; then - eval "exec ${fd}${redir}'${file}'" && break - fi - [[ ${fd} -gt 1024 ]] && die 'could not locate a free temp fd !?' - : $(( ++fd )) - done - : $(( ${var} = fd )) - fi -} - fi |