summaryrefslogtreecommitdiff
path: root/lib/system.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-09-17 14:52:27 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-09-17 14:52:27 +0200
commit3318d6243e21b4106b00c3c5a3db6a6dd666186d (patch)
treed6fa35239c114e26eeb9db8c6d74d99fe840aad7 /lib/system.c
parent6954ba410660b304060e2dddb76ad612cb823f10 (diff)
downloadgnutls-3318d6243e21b4106b00c3c5a3db6a6dd666186d.tar.gz
system.c: simplify gnutls_system_recv_timeout
Diffstat (limited to 'lib/system.c')
-rw-r--r--lib/system.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/system.c b/lib/system.c
index d5ad679c73..4d72968f13 100644
--- a/lib/system.c
+++ b/lib/system.c
@@ -167,13 +167,8 @@ int gnutls_system_recv_timeout(gnutls_transport_ptr_t ptr, unsigned int ms)
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
- tv.tv_sec = 0;
- tv.tv_usec = ms * 1000;
-
- while (tv.tv_usec >= 1000000) {
- tv.tv_usec -= 1000000;
- tv.tv_sec++;
- }
+ tv.tv_sec = ms/1000;
+ tv.tv_usec = (ms % 1000) * 1000;
ret = select(fd + 1, &rfds, NULL, NULL, &tv);
if (ret <= 0)