From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D95C61381F3 for ; Tue, 25 Jun 2013 07:48:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 63BB0E0A44; Tue, 25 Jun 2013 07:48:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 00E4AE0A44 for ; Tue, 25 Jun 2013 07:48:41 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1934E33E1C2 for ; Tue, 25 Jun 2013 07:48:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id AC73AE468F for ; Tue, 25 Jun 2013 07:48:39 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1372146498.d74ef62ae6509bad2d1a02d26a69dd4de511b87c.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: bin/helper-functions.sh pym/portage/process.py X-VCS-Directories: bin/ pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: d74ef62ae6509bad2d1a02d26a69dd4de511b87c X-VCS-Branch: master Date: Tue, 25 Jun 2013 07:48:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4a7ff584-c535-4b89-989c-136c7b6682e7 X-Archives-Hash: 0c42450ab3e9fb5a0bdd5e161c12819e commit: d74ef62ae6509bad2d1a02d26a69dd4de511b87c Author: Zac Medico gentoo org> AuthorDate: Tue Jun 25 07:48:18 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Jun 25 07:48:18 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d74ef62a Use /proc/self/fd for solaris compat, bug #474536 --- bin/helper-functions.sh | 4 ++-- pym/portage/process.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh index eb6066f..ecd78c3 100644 --- a/bin/helper-functions.sh +++ b/bin/helper-functions.sh @@ -77,9 +77,9 @@ __redirect_alloc_fd() { # Need to provide the functionality ourselves. local fd=10 local fddir=/dev/fd - # Use /proc//fd if available (/dev/fd + # Prefer /proc/self/fd if available (/dev/fd # doesn't work on solaris, see bug #474536). - [[ -d /proc/${BASHPID}/fd ]] && fddir=/proc/${BASHPID}/fd + [[ -d /proc/self/fd ]] && fddir=/proc/self/fd while :; do # Make sure the fd isn't open. It could be a char device, # or a symlink (possibly broken) to something else. diff --git a/pym/portage/process.py b/pym/portage/process.py index 6969370..7fdc133 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -31,15 +31,15 @@ except ImportError: if sys.hexversion >= 0x3000000: basestring = str -for _fd_dir in ("/dev/fd", "/proc/self/fd"): +# Prefer /proc/self/fd if available (/dev/fd +# doesn't work on solaris, see bug #474536). +for _fd_dir in ("/proc/self/fd", "/dev/fd"): if os.path.isdir(_fd_dir): break else: _fd_dir = None -# Use /proc//fd for SunOS (/dev/fd -# doesn't work on solaris, see bug #474536). -if _fd_dir is not None and platform.system() not in ('SunOS',): +if _fd_dir is not None: def get_open_fds(): return (int(fd) for fd in os.listdir(_fd_dir) if fd.isdigit())