aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fuse.c
diff options
context:
space:
mode:
authorGiulio Benetti <giulio.benetti@benettiengineering.com>2025-04-23 14:28:29 +0200
committerBernd Schubert <bernd@bsbernd.com>2025-04-23 22:20:34 +0200
commit2dcc57693c3ff1d4bcaa52f103633b1fc0042ba4 (patch)
tree1c5ebfae069e9480a03b92d9a302dbb88eba3c35 /lib/fuse.c
parent08ac8aee19938ce86d45c5776c013bc4d9303750 (diff)
downloadlibfuse-2dcc57693c3ff1d4bcaa52f103633b1fc0042ba4.tar.gz
Check if pthread_setname_np() exists before use it
Since pthread_setname_np() is the only pthread function that requires NPTL and it basically only set thread name, let's check if pthread_setname_np() does exist, otherwise let's not call pthread_setname_np() to shrink dependencies. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Diffstat (limited to 'lib/fuse.c')
-rw-r--r--lib/fuse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index 136f0c2..49f5711 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -4917,7 +4917,9 @@ static void *fuse_prune_nodes(void *fuse)
struct fuse *f = fuse;
int sleep_time;
+#ifdef HAVE_PTHREAD_SETNAME_NP
pthread_setname_np(pthread_self(), "fuse_prune_nodes");
+#endif
while(1) {
sleep_time = fuse_clean_cache(f);