From 9547a2ca9e844b757050338a581e69bdca5204f0 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 22 Jun 2013 17:19:52 -0400 Subject: [PATCH] Avoid unused variable warning on Windows Windows has neither O_NONBLOCK nor FIOBIO and sockets aren't file descriptors in any case. Avoid warning that 'flags' is unused in socket_set_nonblocking(). Change-Id: I431cfae3a88577e75b5230f645639b5a17832f5c --- lib/roken/socket.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/roken/socket.c b/lib/roken/socket.c index 65aea15b5..0a8612557 100644 --- a/lib/roken/socket.c +++ b/lib/roken/socket.c @@ -266,9 +266,8 @@ socket_set_tos (rk_socket_t sock, int tos) ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL socket_set_nonblocking(rk_socket_t sock, int nonblock) { - int flags; #if defined(O_NONBLOCK) - flags = fcntl(sock, F_GETFL, 0); + int flags = fcntl(sock, F_GETFL, 0); if (flags == -1) return; if (nonblock) @@ -277,7 +276,7 @@ socket_set_nonblocking(rk_socket_t sock, int nonblock) flags &= ~O_NONBLOCK; fcntl(sock, F_SETFL, flags); #elif defined(FIOBIO) - flags = !!nonblock; + int flags = !!nonblock; return ioctl(sock, FIOBIO, &flags); #endif } -- 2.11.4.GIT