Move ZiposHandle inside __vforked block

This commit is contained in:
Jōshin 2023-12-12 15:55:01 -05:00
parent 440accd4a3
commit 469bfdaab9
No known key found for this signature in database

View file

@ -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;