summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-12-03 08:15:14 +0000
committerMike Frysinger <vapier@gentoo.org>2013-12-03 08:15:14 +0000
commitf2ce37ff497733b29d2c31197c768e52591573fb (patch)
treead80a034637d0a49326a9fb816e1659c0ba5d3e5 /eclass/multiprocessing.eclass
parentVersion bump. (diff)
downloadgentoo-2-f2ce37ff497733b29d2c31197c768e52591573fb.tar.gz
gentoo-2-f2ce37ff497733b29d2c31197c768e52591573fb.tar.bz2
gentoo-2-f2ce37ff497733b29d2c31197c768e52591573fb.zip
add a /dev/fd sanity check #479656
Diffstat (limited to 'eclass/multiprocessing.eclass')
-rw-r--r--eclass/multiprocessing.eclass9
1 files changed, 8 insertions, 1 deletions
diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.eclass
index cccf113c5f32..025d75519a7a 100644
--- a/eclass/multiprocessing.eclass
+++ b/eclass/multiprocessing.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multiprocessing.eclass,v 1.4 2013/11/28 20:49:14 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multiprocessing.eclass,v 1.5 2013/12/03 08:15:14 vapier Exp $
# @ECLASS: multiprocessing.eclass
# @MAINTAINER:
@@ -227,6 +227,13 @@ multijob_finish() {
redirect_alloc_fd() {
local var=$1 file=$2 redir=${3:-"<>"}
+ # Make sure /dev/fd is sane. #479656
+ if [[ ! -L /dev/fd ]] ; 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}'"