mirror of
https://github.com/libretro/RetroArch
synced 2025-04-23 11:43:20 +00:00
(Network) Check connect errno for successful connection (#14420)
This commit is contained in:
parent
83ce6f42d9
commit
dbba69a2d1
@ -728,10 +728,16 @@ bool socket_connect_with_timeout(int fd, void *data, int timeout)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Excluded platforms do not have getsockopt implemented [GEKKO],
|
#if defined(GEKKO)
|
||||||
* or it's returned values are unreliable [3DS].
|
/* libogc does not have getsockopt implemented */
|
||||||
*/
|
res = connect(fd, addr->ai_addr, addr->ai_addrlen);
|
||||||
#if !defined(GEKKO) && !defined(_3DS) && defined(SO_ERROR)
|
if (res < 0 && -res != EISCONN)
|
||||||
|
return false;
|
||||||
|
#elif defined(_3DS)
|
||||||
|
/* libctru getsockopt does not return expected value */
|
||||||
|
if (connect(fd, addr->ai_addr, addr->ai_addrlen) < 0 && errno != EISCONN)
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
{
|
{
|
||||||
int error = -1;
|
int error = -1;
|
||||||
socklen_t errsz = sizeof(error);
|
socklen_t errsz = sizeof(error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user