From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/
Date: Tue, 25 Jun 2013 07:48:39 +0000 (UTC) [thread overview]
Message-ID: <1372146498.d74ef62ae6509bad2d1a02d26a69dd4de511b87c.zmedico@gentoo> (raw)
commit: d74ef62ae6509bad2d1a02d26a69dd4de511b87c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 25 07:48:18 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> 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/<pid>/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/<pid>/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())
next reply other threads:[~2013-06-25 7:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 7:48 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-11-17 17:43 [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/ Zac Medico
2013-11-29 23:24 Mike Frysinger
2013-06-23 22:57 Zac Medico
2013-06-23 22:40 Zac Medico
2013-02-11 9:39 Zac Medico
2013-01-19 5:16 Zac Medico
2013-01-19 5:00 Zac Medico
2013-01-19 3:23 Zac Medico
2013-01-19 3:23 Zac Medico
2013-01-19 2:27 Zac Medico
2013-01-19 1:53 Zac Medico
2012-10-18 0:05 Zac Medico
2012-03-17 16:44 Zac Medico
2012-03-11 1:40 Mike Frysinger
2011-12-08 7:26 Zac Medico
2011-06-17 22:35 Zac Medico
2011-06-04 1:39 Zac Medico
2011-02-20 0:00 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372146498.d74ef62ae6509bad2d1a02d26a69dd4de511b87c.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox