Handle interrupt on epoll_wait graciously (allows strace to work)

This commit is contained in:
def 2015-01-04 23:06:48 +01:00
commit f56dcd1505

View file

@ -146,7 +146,11 @@ elif defined(linux):
## on the ``fd``.
result = @[]
let evNum = epoll_wait(s.epollFD, addr s.events[0], 64.cint, timeout.cint)
if evNum < 0: raiseOSError(osLastError())
if evNum < 0:
let err = osLastError()
if err.cint == EINTR:
return @[]
raiseOSError(osLastError())
if evNum == 0: return @[]
for i in 0 .. <evNum:
let fd = s.events[i].data.fd.SocketHandle