From 3dd9a9ff988b349f938cf7d38a155588ac9375b6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 2 May 2016 01:26:19 +0200 Subject: [PATCH] Cleanup --- remote.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/remote.c b/remote.c index 68fd94e731..45caf0ce21 100644 --- a/remote.c +++ b/remote.c @@ -67,6 +67,7 @@ static input_remote_state_t *input_remote_get_state_ptr(void) static bool remote_init_network(rarch_remote_t *handle, uint16_t port, unsigned user) { + int fd; struct addrinfo *res = NULL; port = port + user; @@ -77,12 +78,13 @@ static bool remote_init_network(rarch_remote_t *handle, RARCH_LOG("Bringing up remote interface on port %hu.\n", (unsigned short)port); - handle->net_fd[user] = socket_init((void*)&res, - port, NULL, SOCKET_TYPE_DATAGRAM); + fd = socket_init((void*)&res, port, NULL, SOCKET_TYPE_DATAGRAM); - if (handle->net_fd[user] < 0) + if (fd < 0) goto error; + handle->net_fd[user] = fd; + if (!socket_nonblock(handle->net_fd[user])) goto error;