summaryrefslogtreecommitdiff
path: root/src/config.h
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-05-04 11:08:57 +0200
committerantirez <antirez@gmail.com>2020-05-04 11:09:02 +0200
commit6fe2b5236d2e7aeda2a99ae59ed3f1a7d8427a68 (patch)
tree2d92e39a010c0b67c869fb34817c26e42d55aab6 /src/config.h
parent68b5eed41d9b2a58cd5e7c933d5692a3c5895e8c (diff)
downloadredis-6fe2b5236d2e7aeda2a99ae59ed3f1a7d8427a68.tar.gz
Fix NetBSD build by fixing redis_set_thread_title() support.
See #7188.
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/config.h b/src/config.h
index a322ce354..6025d4e96 100644
--- a/src/config.h
+++ b/src/config.h
@@ -230,9 +230,12 @@ void setproctitle(const char *fmt, ...);
#ifdef __linux__
#define redis_set_thread_title(name) pthread_setname_np(pthread_self(), name)
#else
-#if (defined __NetBSD__ || defined __FreeBSD__ || defined __OpenBSD__)
+#if (defined __FreeBSD__ || defined __OpenBSD__)
#include <pthread_np.h>
#define redis_set_thread_title(name) pthread_set_name_np(pthread_self(), name)
+#elif defined __NetBSD__
+#include <pthread.h>
+#define redis_set_thread_title(name) pthread_setname_np(pthread_self(), name, NULL)
#else
#if (defined __APPLE__ && defined(MAC_OS_X_VERSION_10_7))
int pthread_setname_np(const char *name);