From fe7442f069ba33983395ed35af643571a11d9614 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 7 Jul 2013 14:06:01 +0200 Subject: [PATCH] audiod: Reorder exit log messages a bit. On exit only one emergency message should be printed. If para_audiod receives a signal which causes it to exit, we currently print two messages. This downgrades the loglevel of the first message to NOTICE, and moves the emergency message to the bottom of clean_exit(). --- audiod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audiod.c b/audiod.c index 6afb15ef..91f6e1e6 100644 --- a/audiod.c +++ b/audiod.c @@ -1007,7 +1007,7 @@ static int signal_post_select(struct sched *s, __a_unused struct task *t) case SIGINT: case SIGTERM: case SIGHUP: - PARA_EMERG_LOG("terminating on signal %d\n", signum); + PARA_NOTICE_LOG("received signal %d\n", signum); clean_exit(EXIT_FAILURE, "caught deadly signal"); } return 0; @@ -1136,7 +1136,6 @@ void __noreturn clean_exit(int status, const char *msg) { int i; - PARA_EMERG_LOG("%s\n", msg); if (socket_name) unlink(socket_name); close_stat_pipe(); @@ -1144,6 +1143,7 @@ void __noreturn clean_exit(int status, const char *msg) close_slot(i); audiod_cmdline_parser_free(&conf); close_stat_clients(); + PARA_EMERG_LOG("%s\n", msg); exit(status); } -- 2.39.5