diff options
author | Giulio Benetti <giulio.benetti@benettiengineering.com> | 2025-04-23 14:28:29 +0200 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-04-23 15:00:07 +0200 |
commit | 7c60178b42a301c3cd068d38d5606c9b044ba41c (patch) | |
tree | 7d0f0633ded326d72bb198d1d1e71b3d17d70076 /lib/fuse_loop_mt.c | |
parent | 3863da58b1f7904675ca050434d8219bc410f34a (diff) | |
download | libfuse-7c60178b42a301c3cd068d38d5606c9b044ba41c.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_loop_mt.c')
-rw-r--r-- | lib/fuse_loop_mt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c index 95316f7..d6be998 100644 --- a/lib/fuse_loop_mt.c +++ b/lib/fuse_loop_mt.c @@ -132,7 +132,9 @@ static void *fuse_do_work(void *data) struct fuse_worker *w = (struct fuse_worker *) data; struct fuse_mt *mt = w->mt; +#ifdef HAVE_PTHREAD_SETNAME_NP pthread_setname_np(pthread_self(), "fuse_worker"); +#endif while (!fuse_session_exited(mt->se)) { int isforget = 0; |