Stop handling POLLHUP events, since we're only polling for input and
authorZac Medico <zmedico@gentoo.org>
Sat, 14 Aug 2010 04:29:54 +0000 (21:29 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 14 Aug 2010 04:29:54 +0000 (21:29 -0700)
POLLHUP is really intendend for purposes of output polling. Hopefully
this solves a problem with POLLHUP events causing premature
unregistration of event handlers (and subsequent hang in waitpid).

pym/_emerge/AbstractPollTask.py

index 1feee15f63083110e6d084ecf75e0171b12c317e..b654a615fb252c89ae71bde170ec40004d3de4da 100644 (file)
@@ -10,7 +10,7 @@ class AbstractPollTask(AsynchronousTask):
 
        _bufsize = 4096
        _exceptional_events = PollConstants.POLLERR | PollConstants.POLLNVAL
-       _registered_events = PollConstants.POLLIN | PollConstants.POLLHUP | \
+       _registered_events = PollConstants.POLLIN | \
                _exceptional_events
 
        def _unregister(self):
@@ -21,7 +21,3 @@ class AbstractPollTask(AsynchronousTask):
                        if event & self._exceptional_events:
                                self._unregister()
                                self.cancel()
-                       elif event & PollConstants.POLLHUP:
-                               self._unregister()
-                               self.wait()
-