From b60a970602a276854ca7c0bebd4f0863909872fb Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 16 Feb 2006 11:51:27 +0000 Subject: fix --- sshfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sshfs.c') diff --git a/sshfs.c b/sshfs.c index efec915..f7d720b 100644 --- a/sshfs.c +++ b/sshfs.c @@ -1072,6 +1072,9 @@ static int start_processing_thread(void) { int err; pthread_t thread_id; + sigset_t oldset; + sigset_t newset; + if (sshfs.processing_thread_started) return 0; @@ -1081,12 +1084,19 @@ static int start_processing_thread(void) return -EIO; } + sigemptyset(&newset); + sigaddset(&newset, SIGTERM); + sigaddset(&newset, SIGINT); + sigaddset(&newset, SIGHUP); + sigaddset(&newset, SIGQUIT); + pthread_sigmask(SIG_BLOCK, &newset, &oldset); err = pthread_create(&thread_id, NULL, process_requests, NULL); if (err) { fprintf(stderr, "failed to create thread: %s\n", strerror(err)); return -EIO; } pthread_detach(thread_id); + pthread_sigmask(SIG_SETMASK, &oldset, NULL); sshfs.processing_thread_started = 1; return 0; } -- cgit v1.2.3