summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-08-06 14:21:29 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-08-06 15:27:17 +0200
commit39b3b940084d6d04293504024dd62005348b86cf (patch)
tree36694431b532501970672cd440b08fe3c4e7b518
parent8ad59e6857305264a0e415ce995e02b0ab32f770 (diff)
downloadNim-39b3b940084d6d04293504024dd62005348b86cf.tar.gz
OSX: make tioslectors test green
-rw-r--r--lib/pure/ioselects/ioselectors_kqueue.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pure/ioselects/ioselectors_kqueue.nim b/lib/pure/ioselects/ioselectors_kqueue.nim
index 142e988d0..0e133f650 100644
--- a/lib/pure/ioselects/ioselectors_kqueue.nim
+++ b/lib/pure/ioselects/ioselectors_kqueue.nim
@@ -567,8 +567,11 @@ proc selectInto*[T](s: Selector[T], timeout: int,
         doAssert(true, "Unsupported kqueue filter in the queue!")
 
       if (kevent.flags and EV_EOF) != 0:
+        # TODO this error handling needs to be rethought.
+        # `fflags` can sometimes be `0x80000000` and thus we use 'cast'
+        # here:
         if kevent.fflags != 0:
-          rkey.errorCode = kevent.fflags.OSErrorCode
+          rkey.errorCode = cast[OSErrorCode](kevent.fflags)
         else:
           # This assumes we are dealing with sockets.
           # TODO: For future-proofing it might be a good idea to give the