From: Zac Medico Date: Fri, 24 Sep 2010 02:39:39 +0000 (-0700) Subject: Make EbuildIpcDaemon._input_handler() handle EAGAIN from os.read() X-Git-Tag: v2.2_rc87~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7e5b81da12dd7bd59f6620840dc0d824e3f4d69a;p=portage.git Make EbuildIpcDaemon._input_handler() handle EAGAIN from os.read() for FreeBSD (bug 337465, comment #35). --- 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: