Skip to content
Snippets Groups Projects
Commit 33b5bfb9 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Don't call pthread_condattr_setclock() unless it exists

Fixes bug 17819; bugfix on 0.2.6.3-alpha (specifically, d684dbb0).
parent 784e9fff
No related branches found
No related tags found
No related merge requests found
o Minor bugfixes (compilation):
- Don't try to use the pthrad_condattr_setclock() function unless
it actually exists. Fixes compilation on NetBSD-6.x. Fixes bug
17819; bugfix on 0.2.6.3-alpha.
......@@ -425,6 +425,7 @@ AC_CHECK_FUNCS(
if test "$bwin32" != true; then
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_FUNCS(pthread_create)
AC_CHECK_FUNCS(pthread_condattr_setclock)
fi
if test "$bwin32" = true; then
......
......@@ -185,7 +185,8 @@ tor_cond_init(tor_cond_t *cond)
return -1;
}
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) \
&& defined(HAVE_PTHREAD_CONDATTR_SETCLOCK)
/* Use monotonic time so when we timedwait() on it, any clock adjustment
* won't affect the timeout value. */
if (pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment