This commit is contained in:
Andreas Rumpf 2019-05-13 17:34:15 +02:00
commit fb1c3a95a5

View file

@ -500,7 +500,7 @@ proc selectInto*[T](s: Selector[T], timeout: int,
if (kevent.flags and EV_ERROR) != 0: if (kevent.flags and EV_ERROR) != 0:
rkey.events = {Event.Error} rkey.events = {Event.Error}
rkey.errorCode = kevent.data.OSErrorCode rkey.errorCode = OSErrorCode(kevent.data)
case kevent.filter: case kevent.filter:
of EVFILT_READ: of EVFILT_READ:
@ -576,7 +576,7 @@ proc selectInto*[T](s: Selector[T], timeout: int,
# This assumes we are dealing with sockets. # This assumes we are dealing with sockets.
# TODO: For future-proofing it might be a good idea to give the # TODO: For future-proofing it might be a good idea to give the
# user access to the raw `kevent`. # user access to the raw `kevent`.
rkey.errorCode = ECONNRESET.OSErrorCode rkey.errorCode = OSErrorCode(ECONNRESET)
rkey.events.incl(Event.Error) rkey.events.incl(Event.Error)
results[k] = rkey results[k] = rkey