]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
audiod: Reorder exit log messages a bit.
authorAndre Noll <maan@systemlinux.org>
Sun, 7 Jul 2013 12:06:01 +0000 (14:06 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 22 Sep 2013 00:29:18 +0000 (02:29 +0200)
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

index 6afb15ef74effcc3ffb31be401e7340d2252635a..91f6e1e6a474f165870bb4bbe615dccad4fcffbf 100644 (file)
--- 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);
 }