This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]