diff options
author | unknown <rburnett@bk-internal.mysql.com> | 2005-05-06 15:08:10 +0200 |
---|---|---|
committer | unknown <rburnett@bk-internal.mysql.com> | 2005-05-06 15:08:10 +0200 |
commit | 779ac9cf9e92deb2e3a9d55e3718b7f069998726 (patch) | |
tree | b6b5950dd0695d108e0a13315eba184e9ee8a897 /vio/viosocket.c | |
parent | af5596b32e650287f84650a9dda8a5170a23b6d4 (diff) | |
download | mariadb-git-779ac9cf9e92deb2e3a9d55e3718b7f069998726.tar.gz |
Bug #9721 net_write_timeout not used on Windows
viosocket.c:
Use ?: syntax to simplify code for setting both timeouts
vio/viosocket.c:
Use ?: syntax to simplify code for setting both timeouts
Diffstat (limited to 'vio/viosocket.c')
-rw-r--r-- | vio/viosocket.c | 9 |
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__ */ } |