From fa5af22bb7c53c067c77a68eb0d771393fb21e79 Mon Sep 17 00:00:00 2001 From: "Kirill A. Korinsky" Date: Tue, 19 Nov 2024 20:28:08 +0100 Subject: [PATCH 1/2] Add missed include --- bin/varnishd/acceptor/cache_acceptor.h | 2 ++ 1 file changed, 2 insertions(+) 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; From f9c469dd04ffe852d503636a1d2395828623ba0f Mon Sep 17 00:00:00 2001 From: "Kirill A. Korinsky" Date: Tue, 19 Nov 2024 20:42:10 +0100 Subject: [PATCH 2/2] Use pthread_set_name_np when it available --- bin/varnishd/cache/cache_main.c | 2 ++ configure.ac | 1 + 2 files changed, 3 insertions(+) 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}"