summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-23 19:39:39 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-23 19:42:52 -0700
commit7e5b81da12dd7bd59f6620840dc0d824e3f4d69a (patch)
treea7f2ed82847a5a934e632069de745f25dc8efae8
parentc170cd17602c4b859e666c8b827200d23d9baf30 (diff)
downloadportage-7e5b81da12dd7bd59f6620840dc0d824e3f4d69a.tar.gz
portage-7e5b81da12dd7bd59f6620840dc0d824e3f4d69a.tar.bz2
portage-7e5b81da12dd7bd59f6620840dc0d824e3f4d69a.zip
Make EbuildIpcDaemon._input_handler() handle EAGAIN from os.read()
for FreeBSD (bug 337465, comment #35).
-rw-r--r--pym/_emerge/EbuildIpcDaemon.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/pym/_emerge/EbuildIpcDaemon.py b/pym/_emerge/EbuildIpcDaemon.py
index d418fc80a..0c8ea3ea8 100644
--- a/pym/_emerge/EbuildIpcDaemon.py
+++ b/pym/_emerge/EbuildIpcDaemon.py
@@ -36,7 +36,13 @@ class EbuildIpcDaemon(FifoIpcDaemon):
# array.fromfile() and file.read() are both known to
# erroneously return an empty string from this
# non-blocking fifo stream on FreeBSD (bug #337465).
- data = os.read(fd, self._bufsize)
+ try:
+ data = os.read(fd, self._bufsize)
+ except OSError as e:
+ if e.errno != errno.EAGAIN:
+ raise
+ # Assume that another event will be generated
+ # if there's any relevant data.
if data: