Fix socket_open when the connect fails, -1 is not set after closing sockfd

This commit is contained in:
number201724 2024-07-09 03:16:26 +08:00
parent 27f451a868
commit a10fdfa6a1
No known key found for this signature in database
GPG Key ID: ED0BCCF48B8119D1

View File

@ -142,7 +142,10 @@ static cell AMX_NATIVE_CALL socket_open(AMX *amx, cell *params)
if(nonblocking_socket && (errno == EINPROGRESS || errno == EWOULDBLOCK)) if(nonblocking_socket && (errno == EINPROGRESS || errno == EWOULDBLOCK))
connect_inprogress = true; connect_inprogress = true;
else else
{
close(sockfd); close(sockfd);
sockfd = -1;
}
} }
else else
{ {