mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-20 01:50:26 -05:00
[misc] Explicitly check for pthread_setname_np/pthread_set_name_np
Seems there is no pthread_setname_np in OpenWrt
This commit is contained in:
@@ -38,6 +38,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <pthread.h>
|
||||
#ifdef HAVE_PTHREAD_NP_H
|
||||
# include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
#include <unistr.h>
|
||||
#include <unictype.h>
|
||||
@@ -45,10 +48,6 @@
|
||||
|
||||
#include <event2/event.h>
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
# include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
# include <regex.h>
|
||||
#endif
|
||||
@@ -2165,9 +2164,9 @@ filescanner_init(void)
|
||||
goto thread_fail;
|
||||
}
|
||||
|
||||
#if defined(__linux__)
|
||||
#if defined(HAVE_PTHREAD_SETNAME_NP)
|
||||
pthread_setname_np(tid_scan, "filescanner");
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#elif defined(HAVE_PTHREAD_SET_NAME_NP)
|
||||
pthread_set_name_np(tid_scan, "filescanner");
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user