summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-03 20:33:39 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-03 20:33:39 +0200
commit59b92b00c2f2bf4cc4798b6478b2566ddcbc8da5 (patch)
tree8ffb508fdd4439ccbf940424626f6f844985901b /src
parent14f692c2ae784e86218b1696e9af7e8664ee0f82 (diff)
parent8cec95b777f9e52efceb558f47804572b9752b88 (diff)
downloaddabmux-59b92b00c2f2bf4cc4798b6478b2566ddcbc8da5.tar.gz
dabmux-59b92b00c2f2bf4cc4798b6478b2566ddcbc8da5.tar.bz2
dabmux-59b92b00c2f2bf4cc4798b6478b2566ddcbc8da5.zip
Merge next into servicelinking
Diffstat (limited to 'src')
-rw-r--r--src/DabMux.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 9699ea6..689b762 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -139,37 +139,40 @@ using boost::property_tree::ptree_error;
volatile sig_atomic_t running = 1;
+/* We are not allowed to use etiLog in the signal handler,
+ * because etiLog uses mutexes
+ */
void signalHandler(int signum)
{
#ifdef _WIN32
- etiLog.log(debug, "\npid: %i\n", _getpid());
+ fprintf(stderr, "\npid: %i\n", _getpid());
#else
- etiLog.log(debug, "\npid: %i, ppid: %i\n", getpid(), getppid());
+ fprintf(stderr, "\npid: %i, ppid: %i\n", getpid(), getppid());
#endif
#define SIG_MSG "Signal received: "
switch (signum) {
#ifndef _WIN32
case SIGHUP:
- etiLog.log(debug, SIG_MSG "SIGHUP\n");
+ fprintf(stderr, SIG_MSG "SIGHUP\n");
break;
case SIGQUIT:
- etiLog.log(debug, SIG_MSG "SIGQUIT\n");
+ fprintf(stderr, SIG_MSG "SIGQUIT\n");
break;
case SIGPIPE:
- etiLog.log(debug, SIG_MSG "SIGPIPE\n");
+ fprintf(stderr, SIG_MSG "SIGPIPE\n");
return;
break;
#endif
case SIGINT:
- etiLog.log(debug, SIG_MSG "SIGINT\n");
+ fprintf(stderr, SIG_MSG "SIGINT\n");
break;
case SIGTERM:
- etiLog.log(debug, SIG_MSG "SIGTERM\n");
- etiLog.log(debug, "Exiting software\n");
+ fprintf(stderr, SIG_MSG "SIGTERM\n");
+ fprintf(stderr, "Exiting software\n");
exit(0);
break;
default:
- etiLog.log(debug, SIG_MSG "number %i\n", signum);
+ fprintf(stderr, SIG_MSG "number %i\n", signum);
}
#ifndef _WIN32
killpg(0, SIGPIPE);