mirror of
https://github.com/mirror/wget.git
synced 2025-01-06 10:20:56 +08:00
[svn] Check that _POSIX_CLOCK_MONOTONIC >= 0 before using it.
This commit is contained in:
parent
fbea09290b
commit
c159a45df1
@ -1,5 +1,8 @@
|
|||||||
2005-04-08 Hrvoje Niksic <hniksic@xemacs.org>
|
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
|
* ptimer.c (ptimer_init): Check whether _POSIX_MONOTONIC_CLOCK is
|
||||||
defined instead of whether it's greater than 0. glibc defines it
|
defined instead of whether it's greater than 0. glibc defines it
|
||||||
to 0, but still makes it available via sysconf.
|
to 0, but still makes it available via sysconf.
|
||||||
|
@ -183,7 +183,7 @@ ptimer_init (void)
|
|||||||
{
|
{
|
||||||
struct timespec res;
|
struct timespec res;
|
||||||
|
|
||||||
#ifdef _POSIX_MONOTONIC_CLOCK
|
#if _POSIX_MONOTONIC_CLOCK >= 0 /* -1 means not supported */
|
||||||
if (sysconf (_SC_MONOTONIC_CLOCK) > 0)
|
if (sysconf (_SC_MONOTONIC_CLOCK) > 0)
|
||||||
posix_clock_id = CLOCK_MONOTONIC;
|
posix_clock_id = CLOCK_MONOTONIC;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user