From 23074ce4a74ff8db029dc70ff93695233ca69964 Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Sun, 18 Feb 2018 14:45:56 +0100 Subject: [PATCH] include: compat.h, fix the return result of pthread_set_name() On FreeBSD the function type is void(). Make it compatible with return value on other platforms. Signed-off-by: Willem Jan Withagen --- src/include/compat.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/include/compat.h b/src/include/compat.h index 0dad0ea0206..d60e4c3c445 100644 --- a/src/include/compat.h +++ b/src/include/compat.h @@ -145,8 +145,10 @@ #define ceph_pthread_setname pthread_setname_np #endif #elif defined(HAVE_PTHREAD_SET_NAME_NP) - /* Fix a small name diff */ - #define ceph_pthread_setname pthread_set_name_np + /* Fix a small name diff and return 0 */ + #define ceph_pthread_setname(thread, name) ({ \ + pthread_set_name_np(thread, name); \ + 0; }) #else /* compiler warning free success noop */ #define ceph_pthread_setname(thread, name) ({ \ -- 2.39.5