From cc881162feaa990e1d2a253a9bb9bd9a0839ee3a Mon Sep 17 00:00:00 2001 From: Tanguy Date: Sun, 23 Oct 2022 17:56:50 +0200 Subject: [PATCH] fix windows --- chronos/asyncloop.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chronos/asyncloop.nim b/chronos/asyncloop.nim index 1fd95198..fd4a587a 100644 --- a/chronos/asyncloop.nim +++ b/chronos/asyncloop.nim @@ -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.