]> sjero.net Git - wget/commitdiff
[svn] Check that _POSIX_CLOCK_MONOTONIC >= 0 before using it.
authorhniksic <devnull@localhost>
Thu, 7 Apr 2005 23:38:08 +0000 (16:38 -0700)
committerhniksic <devnull@localhost>
Thu, 7 Apr 2005 23:38:08 +0000 (16:38 -0700)
src/ChangeLog
src/ptimer.c

index bddaa88c72e0a57de764725f922fbb583d1d9ec9..a2a621062c25e42dd6a9d8caf00efe4617291a93 100644 (file)
@@ -1,5 +1,8 @@
 2005-04-08  Hrvoje Niksic  <hniksic@xemacs.org>
 
+       * ptimer.c (ptimer_init): In fact, _POSIX_MONOTONIC_CLOCK needs to
+       be >= 0.
+
        * ptimer.c (ptimer_init): Check whether _POSIX_MONOTONIC_CLOCK is
        defined instead of whether it's greater than 0.  glibc defines it
        to 0, but still makes it available via sysconf.
index 45a389a847e67db993c0880ef8039596e6093662..47980cfcd2edc1bf0a34763d28c9686200c4d2cc 100644 (file)
@@ -183,7 +183,7 @@ ptimer_init (void)
 {
   struct timespec res;
 
-#ifdef _POSIX_MONOTONIC_CLOCK
+#if _POSIX_MONOTONIC_CLOCK >= 0                   /* -1 means not supported */
   if (sysconf (_SC_MONOTONIC_CLOCK) > 0)
     posix_clock_id = CLOCK_MONOTONIC;
   else