LibCore: Use WinSock2 closesocket() in PosixSocketHelper::close()

Our Core::System::is_socket() helper is not very robust, as it was
incorrectly marking m_fd as a non-socket fd. This meant we were trying
to call CLoseHandle() on a socket which fails. We can just call
closesocket() directly given we are in an explicit socket-only context.
This commit is contained in:
ayeteadoe 2025-08-29 09:31:31 -07:00 committed by Andrew Kaster
parent 7683f1285f
commit 5e529fc603
Notes: github-actions[bot] 2025-10-30 03:08:58 +00:00

View file

@ -137,7 +137,7 @@ void PosixSocketHelper::close()
// shutdown is required for another end to receive FD_CLOSE
shutdown(m_fd, SD_BOTH);
MUST(System::close(m_fd));
closesocket(m_fd);
m_fd = -1;
}