-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-10382 Using systemd, mariadb doesn't restart on crashes
when crashing on a signal, don't exit(), but re-signal it, so that the caller could check WIFSIGNALED()
- Loading branch information
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) | |
if (segfaulted) | ||
{ | ||
my_safe_printf_stderr("Fatal " SIGNAL_FMT " while backtracing\n", sig); | ||
_exit(1); /* Quit without running destructors */ | ||
goto end; | ||
} | ||
|
||
segfaulted = 1; | ||
|
@@ -301,9 +301,11 @@ extern "C" sig_handler handle_fatal_signal(int sig) | |
#ifndef __WIN__ | ||
/* | ||
Quit, without running destructors (etc.) | ||
Use a signal, because the parent (systemd) can check that with WIFSIGNALED | ||
On Windows, do not terminate, but pass control to exception filter. | ||
*/ | ||
_exit(1); // Using _exit(), since exit() is not async signal safe | ||
signal(sig, SIG_DFL); | ||
kill(getpid(), sig); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vuvova
Author
Member
|
||
#else | ||
return; | ||
#endif | ||
|
Why not raise()?