]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't call pthread_condattr_setclock() unless it exists
authorNick Mathewson <nickm@torproject.org>
Wed, 16 Dec 2015 14:23:44 +0000 (09:23 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 16 Dec 2015 14:23:44 +0000 (09:23 -0500)
Fixes bug 17819; bugfix on 0.2.6.3-alpha (specifically, d684dbb0).

changes/bug17819 [new file with mode: 0644]
configure.ac
src/common/compat_pthreads.c

diff --git a/changes/bug17819 b/changes/bug17819
new file mode 100644 (file)
index 0000000..45c55f7
--- /dev/null
@@ -0,0 +1,4 @@
+  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.
index d37c34daae64a62f3704ce6e5654e99edf876352..2f755683847c15905744a9e8775dcc7cdd5ec338 100644 (file)
@@ -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
index 4b32fc93d254f36d0246f893206d2a1898323ae6..b1d87d38f21910972ff610fe9940f4674b04c5df 100644 (file)
@@ -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)) {