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.
This commit is contained in:
parent
c7d8500634
commit
d7cb098f1d
10
sshfs.c
10
sshfs.c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue