diff options
Diffstat (limited to 'pym/portage.py')
-rw-r--r-- | pym/portage.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py index 1b97fa855..2cd342e5a 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -2420,8 +2420,16 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero for f in events[0]: # Use non-blocking mode to prevent read # calls from blocking indefinitely. - fcntl.fcntl(f.fileno(), fcntl.F_SETFL, - fd_flags[f] | os.O_NONBLOCK) + try: + fcntl.fcntl(f.fileno(), fcntl.F_SETFL, + fd_flags[f] | os.O_NONBLOCK) + except EnvironmentError, e: + if e.errno != errno.EAGAIN: + raise + del e + # The EAGAIN error signals eof on FreeBSD. + eof = True + break buf = array.array('B') try: buf.fromfile(f, buffsize) |