Hopefully prevent close socket race condition

This commit is contained in:
Jack Garrard 2022-10-27 00:26:26 -07:00
parent 7c17db2d93
commit 89415e6f96

View file

@ -72,12 +72,13 @@ s32 SocketBase::getFd() {
bool SocketBase::closeSocket() {
this->socket_log_state = SOCKET_LOG_DISCONNECTED; // probably not safe to assume socket will be closed
if (this->socket_log_state != SOCKET_LOG_DISCONNECTED) {
nn::Result result = nn::socket::Close(this->socket_log_socket);
if (result.isSuccess()) {
this->socket_log_state = SOCKET_LOG_DISCONNECTED;
}
return result.isSuccess();
}
return true;
}