select: epoll.register(): Handle case of fd have been already registered.

Is this correct enough? Certainly, Python's epoll should not be fire-once?
asyncio-segfault
Paul Sokolovsky 2014-04-20 06:10:27 +03:00
rodzic 1cc01656f7
commit 52ac4308f7
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -37,6 +37,8 @@ class Epoll:
retval = fd
s = struct.pack(self.epoll_event, eventmask, retval)
r = epoll_ctl(self.epfd, EPOLL_CTL_ADD, fd, s)
if r == -1 and os.errno.get() == 17:
r = epoll_ctl(self.epfd, EPOLL_CTL_MOD, fd, s)
os.check_error(r)
def poll(self, timeout=-1):