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
proc closeIoHandler(disp: PDispatcher) {.raises: [Defect, OSError].} =
if not disp.ioPort.closeHandle():
raiseOSError(osLastError)
if disp.ioPort.closeHandle() == 0:
raiseOSError(osLastError())
proc register*(fd: AsyncFD) {.raises: [Defect, CatchableError].} =
## Register file descriptor ``fd`` in thread's dispatcher.