summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-06 14:53:57 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-06 14:53:57 -0700
commitd08d8da197798a45c423dd0cf54c63a2badcb317 (patch)
tree38216c5be2493500e95f26f45dd8e1be039e509f
parentbd513bafdd79ec5ebd55b6dbb82d5cc42a3204b6 (diff)
downloadportage-d08d8da197798a45c423dd0cf54c63a2badcb317.tar.gz
portage-d08d8da197798a45c423dd0cf54c63a2badcb317.tar.bz2
portage-d08d8da197798a45c423dd0cf54c63a2badcb317.zip
Bug #339976 - Suppress fifo POLLHUP events.
-rw-r--r--pym/_emerge/EbuildIpcDaemon.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pym/_emerge/EbuildIpcDaemon.py b/pym/_emerge/EbuildIpcDaemon.py
index 0c8ea3ea8..e6ee82b1e 100644
--- a/pym/_emerge/EbuildIpcDaemon.py
+++ b/pym/_emerge/EbuildIpcDaemon.py
@@ -55,6 +55,17 @@ class EbuildIpcDaemon(FifoIpcDaemon):
# any exception when given corrupt data.
pass
else:
+
+ # Re-open the input stream, in order to suppress
+ # POLLHUP events (bug #339976).
+ self._files.pipe_in.close()
+ input_fd = os.open(self.input_fifo, os.O_RDONLY|os.O_NONBLOCK)
+ self._files.pipe_in = os.fdopen(input_fd, 'rb', 0)
+ self.scheduler.unregister(self._reg_id)
+ self._reg_id = self.scheduler.register(
+ self._files.pipe_in.fileno(),
+ self._registered_events, self._input_handler)
+
cmd_key = obj[0]
cmd_handler = self.commands[cmd_key]
reply = cmd_handler(obj)