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...
This commit is contained in:
Daniel Stenberg 2006-12-13 08:42:54 +00:00
parent 75b5e06773
commit 556cafc457

View File

@ -868,7 +868,7 @@ LIBSSH2_API int libssh2_poll(LIBSSH2_POLLFD *fds, unsigned int nfds, long timeou
sysret = poll(sockets, nfds, timeout_remaining); sysret = poll(sockets, nfds, timeout_remaining);
gettimeofday((struct timeval *)&tv_end, NULL); gettimeofday((struct timeval *)&tv_end, NULL);
timeout_remaining -= (tv_end.tv_sec - tv_begin.tv_sec) * 1000; 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 #else
/* If the platform doesn't support gettimeofday, /* 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); gettimeofday((struct timeval *)&tv_end, NULL);
timeout_remaining -= (tv_end.tv_sec - tv_begin.tv_sec) * 1000; 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 #else
/* If the platform doesn't support gettimeofday, /* If the platform doesn't support gettimeofday,