diff --git a/libc/runtime/zipos-close.c b/libc/runtime/zipos-close.c index b316d8c94..c6559016a 100644 --- a/libc/runtime/zipos-close.c +++ b/libc/runtime/zipos-close.c @@ -31,14 +31,14 @@ */ int __zipos_close(int fd) { int rc; - struct ZiposHandle *h; - h = (struct ZiposHandle *)(intptr_t)g_fds.p[fd].handle; if (!IsWindows()) { rc = sys_close(fd); } else { rc = 0; // no system file descriptor needed on nt } if (!__vforked) { + struct ZiposHandle *h; + h = (struct ZiposHandle *)(intptr_t)g_fds.p[fd].handle; __zipos_free(h); } return rc;