Browse Source

Fix close() return code for Winsock

Thus fixing tool/net/dig.com on NT.
main
Justine Tunney 2 years ago
parent
commit
eb4bb43275
  1. 6
      libc/sock/closesocket-nt.c

6
libc/sock/closesocket-nt.c

@ -26,7 +26,11 @@ @@ -26,7 +26,11 @@
textwindows int closesocket$nt(int fd) {
int rc;
if (!isfdkind(fd, kFdSocket)) return ebadf();
rc = __closesocket$nt(g_fds.p[fd].handle) ? 0 : winsockerr();
if (__closesocket$nt(g_fds.p[fd].handle) != -1) {
rc = 0;
} else {
rc = winsockerr();
}
removefd(fd);
return rc;
}

Loading…
Cancel
Save