diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-09-17 14:52:27 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-09-17 14:52:27 +0200 |
commit | 3318d6243e21b4106b00c3c5a3db6a6dd666186d (patch) | |
tree | d6fa35239c114e26eeb9db8c6d74d99fe840aad7 /lib/system.c | |
parent | 6954ba410660b304060e2dddb76ad612cb823f10 (diff) | |
download | gnutls-3318d6243e21b4106b00c3c5a3db6a6dd666186d.tar.gz |
system.c: simplify gnutls_system_recv_timeout
Diffstat (limited to 'lib/system.c')
-rw-r--r-- | lib/system.c | 9 |
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) |