select: Handle EINTR.

pull/26/head
Paul Sokolovsky 2015-03-08 13:27:42 +02:00
rodzic f16ce85359
commit 6c29bfbf57
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -66,8 +66,11 @@ class Epoll:
def poll(self, timeout=-1):
s = bytearray(self.evbuf)
n = epoll_wait(self.epfd, s, 1, timeout)
os.check_error(n)
while True:
n = epoll_wait(self.epfd, s, 1, timeout)
if not os.check_error(n):
break
# TODO: what about timeout value?
res = []
if n > 0:
vals = struct.unpack(epoll_event, s)