Commit bec377a7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

_POSIX_CLOCK_SELECTION at 0 does not mean it's not supported.

parent 3040dc9b
......@@ -67,8 +67,7 @@ struct timespec
int nanosleep(struct timespec *, struct timespec *);
#endif
#ifdef HAVE_CLOCK_NANOSLEEP
# if !defined _POSIX_CLOCK_SELECTION || (_POSIX_CLOCK_SELECTION - 0 <= 0)
#if (!defined (_POSIX_CLOCK_SELECTION)) || (_POSIX_CLOCK_SELECTION < 0)
/*
* We cannot use the monotonic clock is clock selection is not available,
* as it would screw vlc_cond_timedwait() completely. Instead, we have to
......@@ -77,6 +76,8 @@ int nanosleep(struct timespec *, struct timespec *);
*/
# undef CLOCK_MONOTONIC
# define CLOCK_MONOTONIC CLOCK_REALTIME
# ifndef HAVE_CLOCK_NANOSLEEP
# error We have quite a situation here! Fix me if it ever happens.
# endif
#endif
......
......@@ -484,7 +484,7 @@ int __vlc_cond_init( vlc_object_t *p_this, vlc_cond_t *p_condvar )
if (ret)
return ret;
# if defined (_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION - 0 > 0)
# if defined (_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION >= 0)
/* NOTE: This must be the same clock as the one in mtime.c */
pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
# endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment