mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 07:29:23 +00:00
Fix close() return code for Winsock
Thus fixing tool/net/dig.com on NT.
This commit is contained in:
parent
f4f4caab0e
commit
eb4bb43275
1 changed files with 5 additions and 1 deletions
|
@ -26,7 +26,11 @@
|
||||||
textwindows int closesocket$nt(int fd) {
|
textwindows int closesocket$nt(int fd) {
|
||||||
int rc;
|
int rc;
|
||||||
if (!isfdkind(fd, kFdSocket)) return ebadf();
|
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);
|
removefd(fd);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue