diff --git a/libretro-common/net/net_socket.c b/libretro-common/net/net_socket.c index 6e906b6e4c..3b3e9ebfbe 100644 --- a/libretro-common/net/net_socket.c +++ b/libretro-common/net/net_socket.c @@ -126,11 +126,11 @@ int socket_receive_all_blocking(int fd, void *data_, size_t size) bool socket_set_block(int fd, bool block) { #if defined(__CELLOS_LV2__) || defined(VITA) || defined(WIIU) - int i = block; + int i = !block; setsockopt(fd, SOL_SOCKET, SO_NBIO, &i, sizeof(int)); return true; #elif defined(_WIN32) - u_long mode = block; + u_long mode = !block; return ioctlsocket(fd, FIONBIO, &mode) == 0; #else return fcntl(fd, F_SETFL, (fcntl(fd, F_GETFL) & ~O_NONBLOCK) | (block ? 0 : O_NONBLOCK)) == 0;