aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-02-16 11:51:27 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2006-02-16 11:51:27 +0000
commitb60a970602a276854ca7c0bebd4f0863909872fb (patch)
treeeee706675ed81ea826b4893c43c660d54d89e831
parent27c1b7b09d9d5cdd12f3fb90e1dd46fa185f3ab9 (diff)
downloadsshfs-b60a970602a276854ca7c0bebd4f0863909872fb.tar
sshfs-b60a970602a276854ca7c0bebd4f0863909872fb.tar.gz
sshfs-b60a970602a276854ca7c0bebd4f0863909872fb.tar.bz2
sshfs-b60a970602a276854ca7c0bebd4f0863909872fb.zip
fix
-rw-r--r--ChangeLog6
-rw-r--r--sshfs.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1837c76..00dfecb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-16 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Block TERM/INT/HUP/QUIT signals in sshfs reading thread, so they
+ will always be received by the FUSE main thread. Fixes the
+ "double ^C" problem seen on FreeBSD.
+
2006-01-31 Miklos Szeredi <miklos@szeredi.hu>
* Fix problems with nodelay workaround on FreeBSD.
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;
}