The OpenBSD implementation of fuse_set_signal_handlers does not respect existing signal handlers. This causes problems in FUSE programs that expect to be able to set their own signal handlers.
Here is the relevant OpenBSD code from: https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libfuse/fuse.c?rev=1.47&content-type=text/x-cvsweb-markup ``` int fuse_set_signal_handlers(unused struct fuse_session *se) { signal(SIGHUP, ifuse_sighdlr); signal(SIGINT, ifuse_sighdlr); signal(SIGTERM, ifuse_sighdlr); signal(SIGPIPE, SIG_IGN); return (0); } ``` Here is the fuse_set_signal_handlers implementation from the reference libfuse. As you can see it only sets the relevant signal handler if one does not already exist. https://github.com/libfuse/libfuse/blob/fuse-2_9_bugfix/lib/fuse_signals.c#L24-L57 ``` static int set_one_signal_handler(int sig, void (*handler)(int), int remove) { struct sigaction sa; struct sigaction old_sa; memset(&sa, 0, sizeof(struct sigaction)); sa.sa_handler = remove ? SIG_DFL : handler; sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; if (sigaction(sig, NULL, &old_sa) == -1) { perror("fuse: cannot get old signal handler"); return -1; } if (old_sa.sa_handler == (remove ? handler : SIG_DFL) && sigaction(sig, &sa, NULL) == -1) { perror("fuse: cannot set signal handler"); return -1; } return 0; } int fuse_set_signal_handlers(struct fuse_session *se) { if (set_one_signal_handler(SIGHUP, exit_handler, 0) == -1 || set_one_signal_handler(SIGINT, exit_handler, 0) == -1 || set_one_signal_handler(SIGTERM, exit_handler, 0) == -1 || set_one_signal_handler(SIGPIPE, SIG_IGN, 0) == -1) return -1; fuse_instance = se; return 0; } ``` Bill
