MergeProcess: handle POLLHUP from elog pipe
authorZac Medico <zmedico@gentoo.org>
Thu, 9 Feb 2012 05:17:18 +0000 (21:17 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 9 Feb 2012 05:17:18 +0000 (21:17 -0800)
pym/portage/dbapi/_MergeProcess.py

index eed7bd45f237e50a2e23f6047c3767899a1dde28..da278ea2ab62e6f1696d868e63f75cf9f90a85a9 100644 (file)
@@ -83,6 +83,13 @@ class MergeProcess(SpawnProcess):
                                        reporter = getattr(portage.elog.messages, funcname)
                                        reporter(msg, phase=phase, key=key, out=out)
 
+               if event & PollConstants.POLLHUP:
+                       self.scheduler.unregister(self._elog_reg_id)
+                       self._elog_reg_id = None
+                       os.close(self._elog_reader_fd)
+                       self._elog_reader_fd = None
+                       return False
+
                return True
 
        def _spawn(self, args, fd_pipes, **kwargs):