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
This commit is contained in:
Jeffrey Altman
2013-06-22 17:19:52 -04:00
parent b07058dbe1
commit 9547a2ca9e

View File

@@ -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
}