mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
Resolve #4334
This commit is contained in:
@@ -132,11 +132,12 @@ elif defined(linux):
|
||||
s.fds[fd].events = events
|
||||
|
||||
proc unregister*(s: var Selector, fd: SocketHandle) =
|
||||
if epoll_ctl(s.epollFD, EPOLL_CTL_DEL, fd, nil) != 0:
|
||||
let err = osLastError()
|
||||
if err.cint notin {ENOENT, EBADF}:
|
||||
# TODO: Why do we sometimes get an EBADF? Is this normal?
|
||||
raiseOSError(err)
|
||||
if s.fds[fd].events != {}:
|
||||
if epoll_ctl(s.epollFD, EPOLL_CTL_DEL, fd, nil) != 0:
|
||||
let err = osLastError()
|
||||
if err.cint notin {ENOENT, EBADF}:
|
||||
# TODO: Why do we sometimes get an EBADF? Is this normal?
|
||||
raiseOSError(err)
|
||||
s.fds.del(fd)
|
||||
|
||||
proc close*(s: var Selector) =
|
||||
|
||||
Reference in New Issue
Block a user