From 0fac2ed649a4ee7d419c944989d9c8b8e0550081 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 3 May 2024 11:42:27 +0200 Subject: [FUSE] Don't exit on SIGQUIT, just stop uploading --- src/fuse/cowfile.c | 1 - src/fuse/main.c | 9 +-------- src/fuse/main.h | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/fuse/cowfile.c b/src/fuse/cowfile.c index dfa414e..ed370c2 100644 --- a/src/fuse/cowfile.c +++ b/src/fuse/cowfile.c @@ -810,7 +810,6 @@ void quitSigHandler( int sig UNUSED ) { uploadCancelled = true; uploadLoop = false; - main_shutdown(); } /** diff --git a/src/fuse/main.c b/src/fuse/main.c index b665aed..3269d15 100644 --- a/src/fuse/main.c +++ b/src/fuse/main.c @@ -546,6 +546,7 @@ int main( int argc, char *argv[] ) struct sigaction newHandler = { .sa_handler = &noopSigHandler }; sigemptyset( &newHandler.sa_mask ); sigaction( SIGHUP, &newHandler, NULL ); + sigaction( SIGQUIT, &newHandler, NULL ); } while ( 0 ); if ( useCow ) { sigset_t sigmask; @@ -641,11 +642,3 @@ int main( int argc, char *argv[] ) logadd( LOG_DEBUG1, "Terminating. FUSE REPLIED: %d\n", fuse_err ); return fuse_err; } - -void main_shutdown(void) -{ - fuse_session_exit( _fuseSession ); - // TODO: Figure out why this doesn't wake up the fuse mainloop. - // For now, just send SIGQUIT followed by SIGTERM.... - kill( 0, SIGINT ); -} diff --git a/src/fuse/main.h b/src/fuse/main.h index 53d81e4..bf21805 100644 --- a/src/fuse/main.h +++ b/src/fuse/main.h @@ -8,6 +8,5 @@ extern bool useCow; extern bool cow_merge_after_upload; void image_ll_getattr( fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi ); -void main_shutdown(void); #endif /* main_H_ */ -- cgit v1.2.3-55-g7522