diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2017-06-05 17:28:44 -0400 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2017-06-05 17:28:44 -0400 |
commit | d7cb098f1d1f1f5e1663c61794074934443a095d (patch) | |
tree | 5ccca31a6d5a2d4f69c7bc650d3efe80a0a32814 /sshfs.c | |
parent | c7d8500634ecc91cc02be5814428923cee4f844a (diff) | |
download | sshfs-d7cb098f1d1f1f5e1663c61794074934443a095d.tar sshfs-d7cb098f1d1f1f5e1663c61794074934443a095d.tar.gz sshfs-d7cb098f1d1f1f5e1663c61794074934443a095d.tar.bz2 sshfs-d7cb098f1d1f1f5e1663c61794074934443a095d.zip |
main(): setup signal handlers before connecting
Otherwise, aborting the password prompt with Ctrl+C will
also kill the sshfs process and leave the mountpoint inaccessible.
Fixes: #9.
Diffstat (limited to 'sshfs.c')
-rw-r--r-- | sshfs.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -4173,6 +4173,13 @@ int main(int argc, char *argv[]) exit(1); } + res = fuse_set_signal_handlers(fuse_get_session(fuse)); + if (res == -1) { + fuse_unmount(mountpoint, ch); + fuse_destroy(fuse); + exit(1); + } + /* * FIXME: trim $PATH so it doesn't contain anything inside the * mountpoint, which would deadlock. @@ -4185,9 +4192,6 @@ int main(int argc, char *argv[]) } res = fuse_daemonize(foreground); - if (res != -1) - res = fuse_set_signal_handlers(fuse_get_session(fuse)); - if (res == -1) { fuse_unmount(mountpoint, ch); fuse_destroy(fuse); |