summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-27 01:47:37 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-27 01:49:09 +0100
commit297d563de43167f21510061d2de55979a4d65ac4 (patch)
tree0429b3b41714dfc830e2c41ef664e45cdecbd057 /src/core/main.c
parent31a11e8f30449a81867e8fd081e3e76cf6664bb4 (diff)
core: explain why failing to set up the crash handler is not a real problem
http://lists.freedesktop.org/archives/systemd-devel/2015-January/027428.html
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c
index e2e139956..ce37c59e8 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -224,12 +224,17 @@ noreturn static void crash(int sig) {
}
static void install_crash_handler(void) {
- struct sigaction sa = {
+ static const struct sigaction sa = {
.sa_handler = crash,
- .sa_flags = SA_NODEFER,
+ .sa_flags = SA_NODEFER, /* So that we can raise the signal again from the signal handler */
};
+ int r;
- sigaction_many(&sa, SIGNALS_CRASH_HANDLER, -1);
+ /* We ignore the return value here, since, we don't mind if we
+ * cannot set up a crash handler */
+ r = sigaction_many(&sa, SIGNALS_CRASH_HANDLER, -1);
+ if (r < 0)
+ log_debug_errno(r, "I had trouble setting up the crash handler, ignoring: %m");
}
static int console_setup(void) {