diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-04-09 08:23:32 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-02 22:34:33 -0700 |
commit | 89e3ac07aca1def155299aff6f7a57ccafb68fd7 (patch) | |
tree | a956bdfc0a85156abbb5f534e9e03f77b76e6743 | |
parent | 6fd5add005d0660b591d808583d1a6c6a85f1277 (diff) |
Log safely in fatal signal handler
While we probably don't need to be signal safe here since we will never
return to the normal context, the logging signal context check will
cause unsafe logging to be unhandled. Using signal safe logging here
resolves the issue.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | os/osinit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/os/osinit.c b/os/osinit.c index e2a220886..6cc040178 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -113,7 +113,7 @@ OsSigHandler(int signo) const char *dlerr = dlerror(); if (dlerr) { - LogMessage(X_ERROR, "Dynamic loader error: %s\n", dlerr); + LogMessageVerbSigSafe(X_ERROR, 1, "Dynamic loader error: %s\n", dlerr); } #endif /* RTLD_DI_SETSIGNAL */ @@ -129,8 +129,8 @@ OsSigHandler(int signo) #ifdef SA_SIGINFO if (sip->si_code == SI_USER) { - ErrorF("Recieved signal %d sent by process %ld, uid %ld\n", - signo, (long) sip->si_pid, (long) sip->si_uid); + ErrorFSigSafe("Recieved signal %u sent by process %u, uid %u\n", signo, + sip->si_pid, sip->si_uid); } else { switch (signo) { @@ -138,7 +138,7 @@ OsSigHandler(int signo) case SIGBUS: case SIGILL: case SIGFPE: - ErrorF("%s at address %p\n", strsignal(signo), sip->si_addr); + ErrorFSigSafe("%s at address %p\n", strsignal(signo), sip->si_addr); } } #endif |