fix windows

This commit is contained in:
Tanguy 2022-10-23 17:56:50 +02:00
parent a034f11b8b
commit cc881162fe
No known key found for this signature in database
GPG Key ID: 7DD8EC6B6CE6C45E

View File

@ -446,8 +446,8 @@ when defined(windows):
return disp.ioPort return disp.ioPort
proc closeIoHandler(disp: PDispatcher) {.raises: [Defect, OSError].} = proc closeIoHandler(disp: PDispatcher) {.raises: [Defect, OSError].} =
if not disp.ioPort.closeHandle(): if disp.ioPort.closeHandle() == 0:
raiseOSError(osLastError) raiseOSError(osLastError())
proc register*(fd: AsyncFD) {.raises: [Defect, CatchableError].} = proc register*(fd: AsyncFD) {.raises: [Defect, CatchableError].} =
## Register file descriptor ``fd`` in thread's dispatcher. ## Register file descriptor ``fd`` in thread's dispatcher.