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:
@@ -266,9 +266,8 @@ socket_set_tos (rk_socket_t sock, int tos)
|
|||||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
|
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL
|
||||||
socket_set_nonblocking(rk_socket_t sock, int nonblock)
|
socket_set_nonblocking(rk_socket_t sock, int nonblock)
|
||||||
{
|
{
|
||||||
int flags;
|
|
||||||
#if defined(O_NONBLOCK)
|
#if defined(O_NONBLOCK)
|
||||||
flags = fcntl(sock, F_GETFL, 0);
|
int flags = fcntl(sock, F_GETFL, 0);
|
||||||
if (flags == -1)
|
if (flags == -1)
|
||||||
return;
|
return;
|
||||||
if (nonblock)
|
if (nonblock)
|
||||||
@@ -277,7 +276,7 @@ socket_set_nonblocking(rk_socket_t sock, int nonblock)
|
|||||||
flags &= ~O_NONBLOCK;
|
flags &= ~O_NONBLOCK;
|
||||||
fcntl(sock, F_SETFL, flags);
|
fcntl(sock, F_SETFL, flags);
|
||||||
#elif defined(FIOBIO)
|
#elif defined(FIOBIO)
|
||||||
flags = !!nonblock;
|
int flags = !!nonblock;
|
||||||
return ioctl(sock, FIOBIO, &flags);
|
return ioctl(sock, FIOBIO, &flags);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user