aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-11-27 19:22:42 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2005-11-27 19:22:42 +0000
commita90b7349306f10b2a9bde9a2537bf9a852452da4 (patch)
treea3ea2ccf59b9f6a77982409dde1d2180326fb022 /lib
parentbac4c77aad6314ec44a917492a45834ba5575c5c (diff)
downloadlibfuse-a90b7349306f10b2a9bde9a2537bf9a852452da4.tar.gz
*** empty log message ***
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse_loop_mt.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c
index 95399d7..0532230 100644
--- a/lib/fuse_loop_mt.c
+++ b/lib/fuse_loop_mt.c
@@ -116,7 +116,19 @@ static void *do_work(void *data)
static int start_thread(struct fuse_worker *w, pthread_t *thread_id)
{
- int res = pthread_create(thread_id, NULL, do_work, w);
+ sigset_t oldset;
+ sigset_t newset;
+ int res;
+
+ /* Disallow signal reception in worker threads */
+ sigemptyset(&newset);
+ sigaddset(&newset, SIGTERM);
+ sigaddset(&newset, SIGINT);
+ sigaddset(&newset, SIGHUP);
+ sigaddset(&newset, SIGQUIT);
+ pthread_sigmask(SIG_BLOCK, &newset, &oldset);
+ res = pthread_create(thread_id, NULL, do_work, w);
+ pthread_sigmask(SIG_SETMASK, &oldset, NULL);
if (res != 0) {
fprintf(stderr, "fuse: error creating thread: %s\n", strerror(res));
return -1;