X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Futil.c;h=76c33cd7cee0df99f87123ddd4194f400b40d97b;hb=4b570f12766f3c4eeb527de69d8eedfd59c34b86;hp=6a721070afb0cce2810664afa20de60e03831b8c;hpb=d017eeb9f9ebcb46c24a67fd301b3e36cd26a04e;p=sliver-openvswitch.git diff --git a/lib/util.c b/lib/util.c index 6a721070a..76c33cd7c 100644 --- a/lib/util.c +++ b/lib/util.c @@ -46,7 +46,9 @@ DEFINE_PER_THREAD_MALLOCED_DATA(char *, subprogram_name); static char *program_version; /* Buffer used by ovs_strerror(). */ -DEFINE_PER_THREAD_DATA(struct { char s[128]; }, strerror_buffer, { "" }); +DEFINE_STATIC_PER_THREAD_DATA(struct { char s[128]; }, + strerror_buffer, + { "" }); void ovs_assert_failure(const char *where, const char *function, @@ -401,8 +403,10 @@ void set_subprogram_name(const char *name) { free(subprogram_name_set(xstrdup(name))); -#if HAVE_PTHREAD_SETNAME_NP +#if HAVE_GLIBC_PTHREAD_SETNAME_NP pthread_setname_np(pthread_self(), name); +#elif HAVE_NETBSD_PTHREAD_SETNAME_NP + pthread_setname_np(pthread_self(), "%s", name); #elif HAVE_PTHREAD_SET_NAME_NP pthread_set_name_np(pthread_self(), name); #endif