Early exit plugin-scanner on crash

This also prevents the macOS crash-reporter from showing up.
This commit is contained in:
Robin Gareus 2021-07-23 01:37:46 +02:00
parent 209d8b877e
commit 92d8a270a8
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
3 changed files with 15 additions and 3 deletions

View file

@ -21,6 +21,7 @@
#include <getopt.h>
#include <iostream>
#include <string>
#include <unistd.h>
#ifdef PLATFORM_WINDOWS
#include <windows.h>
@ -134,7 +135,9 @@ sig_handler (int sig)
printf ("Error: signal %d\n ---8<---\n", sig);
PBD::stacktrace (std::cout, 15, 2);
printf (" --->8---\n");
::exit (EXIT_FAILURE);
fflush(stdout);
fflush(stderr);
_exit (EXIT_FAILURE);
}
#endif
@ -243,6 +246,7 @@ main (int argc, char **argv)
signal (SIGSEGV, sig_handler);
signal (SIGBUS, sig_handler);
signal (SIGILL, sig_handler);
signal (SIGABRT, sig_handler);
#endif
bool err = false;