fix ldn sockets being regarded as normal socks

This commit is contained in:
lizzie
2026-07-19 01:24:42 +00:00
parent 943b42209e
commit 71aedd5f74
2 changed files with 34 additions and 38 deletions
+3 -3
View File
@@ -526,9 +526,9 @@ std::pair<s32, Network::Errno> BSD::SocketImpl(Network::Domain domain, Network::
auto const bsd_errno = descriptor.socket->Initialize(domain, type, protocol);
descriptor.is_connection_based = IsConnectionBased(type);
#ifdef _WIN32
if (descriptor.socket->fd == INVALID_SOCKET) {
if (descriptor.is_connection_based && descriptor.socket->fd == INVALID_SOCKET) {
#else
if (descriptor.socket->fd == Network::Socket::INVALID_SOCKET) {
if (descriptor.is_connection_based && descriptor.socket->fd == Network::Socket::INVALID_SOCKET) {
#endif
file_descriptors[fd].reset();
return {-1, bsd_errno};
@@ -927,7 +927,7 @@ std::variant<s32, Network::Errno> BSD::DuplicateSocketImpl(s32 fd) {
}
const s32 new_fd = FindFreeFileDescriptorHandle();
if (new_fd < 0) {
if (!IsFileDescriptorValid(new_fd)) {
LOG_ERROR(Service, "No more file descriptors available");
return Network::Errno::MFILE;
}