OSDN Git Service

* times.cc (hires_ms::usecs): Compare the difference.
authorcgf <cgf>
Sun, 27 Mar 2005 23:33:29 +0000 (23:33 +0000)
committercgf <cgf>
Sun, 27 Mar 2005 23:33:29 +0000 (23:33 +0000)
* hires.h: Add parentheses to HIRES_DELAY_MAX.

winsup/cygwin/ChangeLog
winsup/cygwin/cygtls.h
winsup/cygwin/hires.h
winsup/cygwin/signal.cc
winsup/cygwin/times.cc

index 0f420db..b437660 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-27  Pierre Humblet <pierre.humblet@ieee.org>
+
+       * times.cc (hires_ms::usecs): Compare the difference.
+       * hires.h: Add parentheses to HIRES_DELAY_MAX.
+
 2005-03-26  Christopher Faylor  <cgf@timesys.com>
 
        * timer.cc (nanosleep): Treat tv_sec < 0 as invalid.
index 38fe531..9148e2c 100644 (file)
@@ -1,6 +1,6 @@
 /* cygtls.h
 
-   Copyright 2003, 2004 Red Hat, Inc.
+   Copyright 2003, 2004, 2005 Red Hat, Inc.
 
 This software is a copyrighted work licensed under the terms of the
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
index 2c9f09c..a3e15aa 100644 (file)
@@ -19,7 +19,7 @@ details. */
    The tv_sec argument in timeval structures cannot exceed
    HIRES_DELAY_MAX / 1000 - 1, so that adding fractional part
    and rounding won't exceed HIRES_DELAY_MAX */
-#define HIRES_DELAY_MAX (((UINT_MAX - 10000) / 1000) * 1000) + 10
+#define HIRES_DELAY_MAX ((((UINT_MAX - 10000) / 1000) * 1000) + 10)
 
 class hires_base
 {
index 41b4831..1808b24 100644 (file)
@@ -77,7 +77,6 @@ nanosleep (const struct timespec *rqtp, struct timespec *rmtp)
   pthread_testcancel ();
 
   if ((unsigned int) rqtp->tv_sec > (HIRES_DELAY_MAX / 1000 - 1)
-      || rqtp->tv_sec < 0
       || (unsigned int) rqtp->tv_nsec > 999999999)
     {
       set_errno (EINVAL);
index 4c0909e..2ac2ee6 100644 (file)
@@ -597,7 +597,7 @@ hires_ms::usecs (bool justdelta)
   if (!minperiod) /* NO_COPY variable */
     prime ();
   DWORD now = timeGetTime ();
-  if (now < initime_ms)
+  if ((now - initime_ms) < 0)
     {
       inited = 0;
       prime ();