1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-16 08:13:30 +00:00

Fixed subtle issue with socket() on some distros

This commit is contained in:
Bryan Roe
2021-12-12 23:33:12 -08:00
parent 6d76fee0d9
commit 5d248c683e
2 changed files with 18 additions and 7 deletions

View File

@@ -963,7 +963,7 @@ void ILibAsyncSocket_ConnectTo(void* socketModule, struct sockaddr *localInterfa
// Allocate a new socket
if (module->RemoteAddress.sin6_family != AF_UNIX)
{
if (((struct sockaddr_in*)localInterface)->sin_family == AF_UNSPEC || (module->internalSocket = ILibGetSocket(localInterface, SOCK_STREAM, IPPROTO_TCP)) == 0)
if (((struct sockaddr_in*)localInterface)->sin_family == AF_UNSPEC || (module->internalSocket = ILibGetSocket(localInterface, SOCK_STREAM, IPPROTO_TCP)) < 0)
{
module->internalSocket = 0;
module->FinConnect = -1;