From 7e5b81da12dd7bd59f6620840dc0d824e3f4d69a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 23 Sep 2010 19:39:39 -0700 Subject: [PATCH] Make EbuildIpcDaemon._input_handler() handle EAGAIN from os.read() for FreeBSD (bug 337465, comment #35). --- pym/_emerge/EbuildIpcDaemon.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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: -- 2.26.2