mirror of
https://github.com/libretro/RetroArch
synced 2025-03-20 01:21:03 +00:00
Add WIIU ifdef for socket_connect_with_timeout and revert (#14503)
else default codepath
This commit is contained in:
parent
d100e73780
commit
78ffb973b1
@ -762,15 +762,21 @@ bool socket_connect_with_timeout(int fd, void *data, int timeout)
|
|||||||
return false;
|
return false;
|
||||||
#elif defined(_3DS)
|
#elif defined(_3DS)
|
||||||
/* libctru getsockopt does not return expected value */
|
/* libctru getsockopt does not return expected value */
|
||||||
if (connect(fd, addr->ai_addr, addr->ai_addrlen) < 0 && errno != EISCONN)
|
if ((connect(fd, addr->ai_addr, addr->ai_addrlen) < 0) && errno != EISCONN)
|
||||||
|
return false;
|
||||||
|
#elif defined(WIIU)
|
||||||
|
/* On WiiU, getsockopt() returns -1 and sets lastsocketerr() (Wii's
|
||||||
|
* equivalent to errno) to 16. */
|
||||||
|
if ((connect(fd, addr->ai_addr, addr->ai_addrlen) == -1)
|
||||||
|
&& socketlasterr() != SO_EISCONN)
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
int error = -1;
|
int error = -1;
|
||||||
socklen_t errsz = sizeof(error);
|
socklen_t errsz = sizeof(error);
|
||||||
|
|
||||||
/* Only error out here if the getsockopt() call succeeds and error is still set. */
|
getsockopt(fd, SOL_SOCKET, SO_ERROR, (char*)&error, &errsz);
|
||||||
if(!getsockopt(fd, SOL_SOCKET, SO_ERROR, (char*)&error, &errsz) && error)
|
if (error)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user