aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-12-16 09:24:40 -0500
committerNick Mathewson <nickm@torproject.org>2015-12-16 09:24:40 -0500
commit3317cd3a1f4e3a7883bf9a5eba3f9a13097fe437 (patch)
treec47c1c562c73ef4a22369cea373824a526b944e6
parenta5da27cb35987bdab7a9ebec907056be974289a5 (diff)
parent33b5bfb94824a55254f1ffcddf38ac17589a2744 (diff)
downloadtor-3317cd3a1f4e3a7883bf9a5eba3f9a13097fe437.tar.gz
tor-3317cd3a1f4e3a7883bf9a5eba3f9a13097fe437.zip
Merge branch 'maint-0.2.7'
-rw-r--r--changes/bug178194
-rw-r--r--configure.ac1
-rw-r--r--src/common/compat_pthreads.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/changes/bug17819 b/changes/bug17819
new file mode 100644
index 0000000000..45c55f74b6
--- /dev/null
+++ b/changes/bug17819
@@ -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.
diff --git a/configure.ac b/configure.ac
index c723257ea3..25edbaf1d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -422,6 +422,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
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)) {