aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-12-16 09:23:44 -0500
committerNick Mathewson <nickm@torproject.org>2015-12-16 09:23:44 -0500
commit33b5bfb94824a55254f1ffcddf38ac17589a2744 (patch)
treedbdd1f29df57e56476d66bd9d79cb0d79401dd82 /src/common
parent784e9fff9baa4fb63712de5dd9cc0ac530e2eb23 (diff)
downloadtor-33b5bfb94824a55254f1ffcddf38ac17589a2744.tar.gz
tor-33b5bfb94824a55254f1ffcddf38ac17589a2744.zip
Don't call pthread_condattr_setclock() unless it exists
Fixes bug 17819; bugfix on 0.2.6.3-alpha (specifically, d684dbb0).
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat_pthreads.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/compat_pthreads.c b/src/common/compat_pthreads.c
index 4b32fc93d2..b1d87d38f2 100644
--- a/src/common/compat_pthreads.c
+++ b/src/common/compat_pthreads.c
@@ -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)) {