Add a missing call to fuse_set_signal_handlers(3) in fuse_setup(3) so that
authorhelg <helg@openbsd.org>
Thu, 14 Dec 2017 14:50:02 +0000 (14:50 +0000)
committerhelg <helg@openbsd.org>
Thu, 14 Dec 2017 14:50:02 +0000 (14:50 +0000)
any file systems that call fuse_setup(3) or fuse_main(3) trap signals
gracefully.

ok mpi@

lib/libfuse/fuse.c

index 398b8a1..7067a84 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse.c,v 1.38 2017/12/14 13:11:37 helg Exp $ */
+/* $OpenBSD: fuse.c,v 1.39 2017/12/14 14:50:02 helg Exp $ */
 /*
  * Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
  *
@@ -556,6 +556,12 @@ fuse_setup(int argc, char **argv, const struct fuse_operations *ops,
                goto err;
        }
 
+       if (fuse_set_signal_handlers(fuse_get_session(fuse)) == -1) {
+               fuse_unmount(dir, fc);
+               fuse_destroy(fuse);
+               goto err;
+       }
+
        if (mp != NULL)
                *mp = dir;