From 5b5123a79dcab6f7fda3b98f9924492c2a0f643d Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 9 Mar 2017 11:46:15 +0100 Subject: [PATCH] HAVE_PTHREAD instead of HAVE_PTHREADS like unbound --- configure.ac | 4 ++-- src/compat/arc4_lock.c | 2 +- src/context.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 555b7792..2bd99c6f 100644 --- a/configure.ac +++ b/configure.ac @@ -992,7 +992,7 @@ fi #---- check for pthreads library -AC_SEARCH_LIBS([pthread_mutex_init],[pthread],[AC_DEFINE([HAVE_PTHREADS], [1], [Have pthreads library])], [AC_MSG_WARN([pthreads not available])]) +AC_SEARCH_LIBS([pthread_mutex_init],[pthread],[AC_DEFINE([HAVE_PTHREAD], [1], [Have pthreads library])], [AC_MSG_WARN([pthreads not available])]) AC_MSG_CHECKING([whether the C compiler (${CC-cc}) supports the __func__ variable]) AC_LANG_PUSH(C) @@ -1008,7 +1008,7 @@ dnl ----- Start of "Things needed for gldns" section dnl ----- dnl --------------------------------------------------------------------------- -AC_CHECK_HEADERS([stdarg.h stdint.h netinet/in.h arpa/inet.h netdb.h sys/socket.h time.h sys/time.h sys/select.h],,, [AC_INCLUDES_DEFAULT]) +AC_CHECK_HEADERS([stdarg.h stdint.h netinet/in.h arpa/inet.h netdb.h sys/socket.h time.h sys/time.h sys/select.h endian.h],,, [AC_INCLUDES_DEFAULT]) dnl Check the printf-format attribute (if any) dnl result in HAVE_ATTR_FORMAT. diff --git a/src/compat/arc4_lock.c b/src/compat/arc4_lock.c index 34b85974..cb9b5056 100644 --- a/src/compat/arc4_lock.c +++ b/src/compat/arc4_lock.c @@ -34,7 +34,7 @@ #include "config.h" #define LOCKRET(func) func -#ifdef HAVE_PTHREADS +#ifdef HAVE_PTHREAD #include "pthread.h" static pthread_mutex_t arc_lock = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/context.c b/src/context.c index 5421fd81..1237ae7f 100644 --- a/src/context.c +++ b/src/context.c @@ -62,7 +62,7 @@ typedef unsigned short in_port_t; #include #include -#ifdef HAVE_PTHREADS +#ifdef HAVE_PTHREAD #include #endif #include @@ -93,7 +93,7 @@ typedef unsigned short in_port_t; upstream. Using 1 hour for all transports - based on RFC7858 value for for TLS.*/ #define BACKOFF_RETRY 3600 -#ifdef HAVE_PTHREADS +#ifdef HAVE_PTHREAD static pthread_mutex_t ssl_init_lock = PTHREAD_MUTEX_INITIALIZER; #endif static bool ssl_init=false; @@ -1434,7 +1434,7 @@ getdns_context_create_with_extended_memory_functions( /* Unbound needs SSL to be init'ed this early when TLS is used. However we * don't know that till later so we will have to do this every time. */ -#ifdef HAVE_PTHREADS +#ifdef HAVE_PTHREAD pthread_mutex_lock(&ssl_init_lock); #else /* XXX implement Windows-style lock here */ @@ -1444,7 +1444,7 @@ getdns_context_create_with_extended_memory_functions( SSL_library_init(); ssl_init = true; } -#ifdef HAVE_PTHREADS +#ifdef HAVE_PTHREAD pthread_mutex_unlock(&ssl_init_lock); #else /* XXX implement Windows-style unlock here */