Install fatal signal handlers in mkdwarfs and dwarfs

This commit is contained in:
Marcus Holland-Moritz 2020-12-09 12:14:21 +01:00
parent a0a97eeb1b
commit f3b40e6400
2 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#include <filesystem>
#include <folly/Conv.h>
#include <folly/experimental/symbolizer/SignalHandler.h>
#include <fuse3/fuse_lowlevel.h>
@ -449,6 +450,10 @@ int run_fuse(struct fuse_args& args) {
usage(s_opts.progname);
}
if (fuse_opts.foreground) {
folly::symbolizer::installFatalSignalHandler();
}
struct fuse_lowlevel_ops fsops;
::memset(&fsops, 0, sizeof(fsops));

View File

@ -45,6 +45,7 @@
#include <folly/Conv.h>
#include <folly/FileUtil.h>
#include <folly/experimental/symbolizer/SignalHandler.h>
#include <folly/gen/String.h>
#include <fmt/format.h>
@ -624,6 +625,7 @@ int mkdwarfs(int argc, char** argv) {
int main(int argc, char** argv) {
try {
folly::symbolizer::installFatalSignalHandler();
return mkdwarfs(argc, argv);
} catch (std::exception const& e) {
std::cerr << "ERROR: " << folly::exceptionStr(e) << std::endl;