From 556cafc457b795697c7b6ff45b4e366f6a226e5c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 13 Dec 2006 08:42:54 +0000 Subject: [PATCH] Removed use of ceil() since that is a math lib function and getting the exact accuracy of the microsecond to millisecond conversion simply cannot be that important. We don't even explicitly link with -lm... --- src/session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/session.c b/src/session.c index 57ad5fb2..210b2da2 100644 --- a/src/session.c +++ b/src/session.c @@ -868,7 +868,7 @@ LIBSSH2_API int libssh2_poll(LIBSSH2_POLLFD *fds, unsigned int nfds, long timeou sysret = poll(sockets, nfds, timeout_remaining); gettimeofday((struct timeval *)&tv_end, NULL); timeout_remaining -= (tv_end.tv_sec - tv_begin.tv_sec) * 1000; - timeout_remaining -= ceil((tv_end.tv_usec - tv_begin.tv_usec) / 1000); + timeout_remaining -= (tv_end.tv_usec - tv_begin.tv_usec) / 1000; } #else /* If the platform doesn't support gettimeofday, @@ -923,7 +923,7 @@ LIBSSH2_API int libssh2_poll(LIBSSH2_POLLFD *fds, unsigned int nfds, long timeou gettimeofday((struct timeval *)&tv_end, NULL); timeout_remaining -= (tv_end.tv_sec - tv_begin.tv_sec) * 1000; - timeout_remaining -= ceil((tv_end.tv_usec - tv_begin.tv_usec) / 1000); + timeout_remaining -= (tv_end.tv_usec - tv_begin.tv_usec) / 1000; } #else /* If the platform doesn't support gettimeofday,