]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Fix compile error on Mac OS
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 22 Jan 2019 16:55:31 +0000 (17:55 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 22 Jan 2019 16:55:31 +0000 (17:55 +0100)
  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>
lib/frr_pthread.c

index d5a2007c4df64c7b1b1ca3046dcf6ff350516d60..674e9b10e3baa829d5dbaf87d7a69667968b5627 100644 (file)
@@ -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)