diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2018-05-09 07:06:38 -0400 |
---|---|---|
committer | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2018-05-09 08:58:34 -0400 |
commit | 2b2410acb4cca0554ee710ca32bfa58ce49d3204 (patch) | |
tree | bd7377c80db41f78a670ade428343bbee3d60967 | |
parent | 8d1335af8024e3622eaab31520cc2b8a70c0f212 (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#1193929
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
-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 } |