Clean up more WIN32 APIs

This commit is contained in:
Justine Tunney 2023-07-30 16:00:58 -07:00
parent 44b88d659d
commit 929478c524
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
60 changed files with 74 additions and 962 deletions

View file

@ -21,6 +21,7 @@
#include "libc/errno.h"
#include "libc/macros.internal.h"
#include "libc/mem/mem.h"
#include "libc/nt/thunk/msabi.h"
#include "libc/nt/winsock.h"
#include "libc/sock/internal.h"
#include "libc/sock/struct/sockaddr.h"
@ -30,6 +31,8 @@
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/sock.h"
__msabi extern typeof(__sys_closesocket_nt) *const __imp_closesocket;
union AcceptExAddr {
struct sockaddr_storage addr;
char buf[sizeof(struct sockaddr_storage) + 16];
@ -70,7 +73,7 @@ textwindows int sys_accept_nt(struct Fd *fd, struct sockaddr_storage *addr,
if (__wsablock(fd, &overlapped, &completion_flags, kSigOpRestartable,
sockfd->rcvtimeo) == -1) {
WSACloseEvent(overlapped.hEvent);
__sys_closesocket_nt(handle);
__imp_closesocket(handle);
free(sockfd2);
return -1;
}