This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH,HURD] Fix select timeout rounding
- From: Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- To: roland at redhat dot com
- Cc: libc-alpha at sources dot redhat dot com
- Date: Sun, 1 Aug 2010 00:13:54 +0200
- Subject: [PATCH,HURD] Fix select timeout rounding
Hello,
Select is supposed to wait until the timeout is expired. When converted
to ms, it should thus be rounded up instead of down.
Samuel
2010-07-31 Samuel Thibault <samuel.thibault@ens-lyon.org>
* hurd/hurdselect.c (_hurd_select): Round timeout up instead of down
when converting to ms.
diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c
index 544eee9..a7228f0 100644
--- a/hurd/hurdselect.c
+++ b/hurd/hurdselect.c
@@ -52,7 +52,7 @@ _hurd_select (int nfds,
int firstfd, lastfd;
mach_msg_timeout_t to = (timeout != NULL ?
(timeout->tv_sec * 1000 +
- timeout->tv_nsec / 1000000) :
+ (timeout->tv_nsec + 999999) / 1000000) :
0);
struct
{