diff --git a/bin/varnishd/acceptor/cache_acceptor.h b/bin/varnishd/acceptor/cache_acceptor.h index 79c7a0deca..3815b8289b 100644 --- a/bin/varnishd/acceptor/cache_acceptor.h +++ b/bin/varnishd/acceptor/cache_acceptor.h @@ -30,6 +30,8 @@ * */ +#include + /* cache_acceptor.c */ struct listen_sock; struct listen_arg; diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c index c71a6a108c..c377e314ef 100644 --- a/bin/varnishd/cache/cache_main.c +++ b/bin/varnishd/cache/cache_main.c @@ -163,6 +163,8 @@ THR_SetName(const char *name) # else thr_setname_generic(name); # endif +#elif defined(HAVE_PTHREAD_SET_NAME_NP) + (void)pthread_set_name_np(pthread_self(), name); #endif } diff --git a/configure.ac b/configure.ac index 3f7b252571..08d99197fe 100644 --- a/configure.ac +++ b/configure.ac @@ -228,6 +228,7 @@ AC_CHECK_FUNCS([fnmatch], [], [AC_MSG_ERROR([fnmatch(3) is required])]) save_LIBS="${LIBS}" LIBS="${PTHREAD_LIBS}" AC_CHECK_FUNCS([pthread_setname_np]) +AC_CHECK_FUNCS([pthread_set_name_np]) AC_CHECK_FUNCS([pthread_mutex_isowned_np]) AC_CHECK_FUNCS([pthread_getattr_np]) LIBS="${save_LIBS}"