summaryrefslogtreecommitdiff
path: root/vio/viosocket.c
diff options
context:
space:
mode:
Diffstat (limited to 'vio/viosocket.c')
-rw-r--r--vio/viosocket.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/vio/viosocket.c b/vio/viosocket.c
index b6aa793f57b..172d9127dc2 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -323,12 +323,9 @@ void vio_timeout(Vio *vio __attribute__((unused)),
{
#ifdef __WIN__
ulong wait_timeout= (ulong) timeout * 1000;
- if (which == 0)
- (void) setsockopt(vio->sd, SOL_SOCKET, SO_RCVTIMEO, (char*) &wait_timeout,
- sizeof(wait_timeout));
- else
- (void) setsockopt(vio->sd, SOL_SOCKET, SO_SNDTIMEO, (char*) &wait_timeout,
- sizeof(wait_timeout));
+ (void) setsockopt(vio->sd, SOL_SOCKET,
+ which ? SO_SNDTIMEO : SO_RCVTIMEO, (char*) &wait_timeout,
+ sizeof(wait_timeout));
#endif /* __WIN__ */
}