summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2018-05-09 07:06:38 -0400
committerjiffin tony Thottan <jthottan@redhat.com>2018-06-11 06:38:49 +0000
commit616bdb2aab959371b981be83f17a8cd46d8e43f3 (patch)
tree6e81268cbcc95a4846c641b0217cfea791bf1ad3 /libglusterfs
parent18ee1fa84700afc1a8b103847eadac8ab099f746 (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 BUG: 1576816 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 772f4e05ad7..3ae77579dae 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -54,6 +54,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
@@ -3756,11 +3760,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
}