summaryrefslogtreecommitdiff
path: root/lib/frr_pthread.c
diff options
context:
space:
mode:
authorRuben Kerkhof <ruben@rubenkerkhof.com>2019-01-22 17:55:31 +0100
committerRuben Kerkhof <ruben@rubenkerkhof.com>2019-01-22 17:55:31 +0100
commita64c953a907b52312cd152b963ac49a97e2fc914 (patch)
treebc01965604964fa883e718e861fc0e7b6bb33352 /lib/frr_pthread.c
parentdbd10c03e81ca616936ee34fc3aac6c6762b02f7 (diff)
Fix compile error on Mac OS
CC lib/frr_pthread.lo lib/frr_pthread.c:128:40: error: too many arguments to function call, expected 1, have 3 ret = pthread_setname_np(fpt->thread, fpt->os_name, NULL); ~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/pthread.h:512:1: note: 'pthread_setname_np' declared here __API_AVAILABLE(macos(10.6), ios(3.2)) Mac OS does have pthread_setname_np, but we can't use it here since it only accepts a single argument, the thread name, and thus only works for the current thread. Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
Diffstat (limited to 'lib/frr_pthread.c')
-rw-r--r--lib/frr_pthread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c
index d5a2007c4d..674e9b10e3 100644
--- a/lib/frr_pthread.c
+++ b/lib/frr_pthread.c
@@ -124,7 +124,7 @@ int frr_pthread_set_name(struct frr_pthread *fpt)
#ifdef HAVE_PTHREAD_SETNAME_NP
# ifdef GNU_LINUX
ret = pthread_setname_np(fpt->thread, fpt->os_name);
-# else /* NetBSD */
+# elif defined(__NetBSD__)
ret = pthread_setname_np(fpt->thread, fpt->os_name, NULL);
# endif
#elif defined(HAVE_PTHREAD_SET_NAME_NP)