diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2018-05-09 07:06:38 -0400 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2018-05-10 12:46:57 +0000 |
commit | 83f50e831cab0b8de7870a75098298f370804e04 (patch) | |
tree | 21b7acd056f60b01d5ed5b59caca47c498de32f3 /libglusterfs | |
parent | c7e281fcb7fcabb13132ba3a3e7a1a784b020719 (diff) |
core: FreeBSD has pthread_set_name_np() (versus pthread_setname_np())
And has had it since at least FreeBSD 9.0
Reported-by: Roman Serbski <mefystofel@gmail.com>
Change-Id: I52cfde7f2f7a82d0e66465ac392ed7e201e1653b
updates: bz#1576814
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/common-utils.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 56fc0495572..6c28690c8ff 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -53,6 +53,10 @@ #include <ifaddrs.h> #include "libglusterfs-messages.h" #include "protocol-common.h" +#ifdef __FreeBSD__ +#include <pthread_np.h> +#undef BIT_SET +#endif #ifndef AI_ADDRCONFIG #define AI_ADDRCONFIG 0 @@ -3900,11 +3904,13 @@ gf_thread_create (pthread_t *thread, const pthread_attr_t *attr, pthread_setname_np(*thread, thread_name); #elif defined(__NetBSD__) pthread_setname_np(*thread, thread_name, NULL); + #elif defined(__FreeBSD__) + pthread_set_name_np(*thread, thread_name); #else gf_msg (THIS->name, GF_LOG_WARNING, 0, LG_MSG_PTHREAD_NAMING_FAILED, - "Thread names not implemented on this " - "platform"); + "Could not set thread name: %s", + thread_name); #endif } |