summaryrefslogtreecommitdiff
path: root/sockcompat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sockcompat.c')
-rw-r--r--sockcompat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sockcompat.c b/sockcompat.c
index 38cb9e5..c3b6f66 100644
--- a/sockcompat.c
+++ b/sockcompat.c
@@ -197,7 +197,7 @@ int win32_getsockopt(SOCKET sockfd, int level, int optname, void *optval, sockle
socklen_t dwlen = 0;
ret = getsockopt(sockfd, level, optname, (char *)&timeout, &dwlen);
tv->tv_sec = timeout / 1000;
- tv->tv_usec = timeout * 1000;
+ tv->tv_usec = (timeout * 1000) % 1000000;
} else {
ret = WSAEFAULT;
}