From 3686e6ed9b6e62944ecbbd6ed856b85195bdde67 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 7 Mar 2026 12:22:33 +0100 Subject: [PATCH] Fix pcl-3la.2: remove spurious fuse_loop_mt while-loop and exit(0) fuse_loop_mt() already loops internally; wrapping it in an additional while loop caused repeated re-entry after normal exit. Also removes the exit(0) call in the shutdown path so fuse_destroy() and other cleanup run properly on shutdown. Co-Authored-By: Claude Sonnet 4.6 --- pclsync/pfs.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/pclsync/pfs.c b/pclsync/pfs.c index 178d409..5a9987c 100644 --- a/pclsync/pfs.c +++ b/pclsync/pfs.c @@ -3651,21 +3651,13 @@ static void psync_fuse_thread() { } pthread_mutex_unlock(&start_mutex); pdbg_logf(D_NOTICE, "running fuse_loop_mt"); - - // Check shutdown flag periodically during FUSE loop - while (!shutdown_requested) { - fr = fuse_loop_mt(psync_fuse); - if (fr != 0 || shutdown_requested) { - break; - } - } - + fr = fuse_loop_mt(psync_fuse); + if (shutdown_requested) { pdbg_logf(D_NOTICE, "shutdown requested, exiting fuse loop"); pfs_do_stop(); - exit(0); } - + pdbg_logf(D_NOTICE, "fuse_loop_mt exited with code %d, running fuse_destroy", fr); pthread_mutex_lock(&start_mutex); fuse_destroy(psync_fuse);