From 9d35fa935becc285c5518b198628615d35ea6b74 Mon Sep 17 00:00:00 2001 From: christian linke Date: Tue, 16 Oct 2012 19:31:43 +0200 Subject: * nicer handling of singal for exit. Signed-off-by: christian linke --- AudioManagerDaemon/src/CAmControlReceiver.cpp | 4 ++++ AudioManagerDaemon/src/main.cpp | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'AudioManagerDaemon/src') diff --git a/AudioManagerDaemon/src/CAmControlReceiver.cpp b/AudioManagerDaemon/src/CAmControlReceiver.cpp index 51a2225..583ad0d 100644 --- a/AudioManagerDaemon/src/CAmControlReceiver.cpp +++ b/AudioManagerDaemon/src/CAmControlReceiver.cpp @@ -21,6 +21,7 @@ #include "CAmControlReceiver.h" #include +#include #include "config.h" #include "CAmDatabaseHandler.h" #include "CAmRoutingSender.h" @@ -482,6 +483,9 @@ void CAmControlReceiver::confirmControllerReady() void CAmControlReceiver::confirmControllerRundown() { + logInfo ("CAmControlReceiver::confirmControllerRundown(), exiting regularly"); + //once the controller is ready, it will exit. + exit (0); //todo: one time implement here system interaction with NSM } diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp index b5eed1c..3d552f5 100755 --- a/AudioManagerDaemon/src/main.cpp +++ b/AudioManagerDaemon/src/main.cpp @@ -264,13 +264,11 @@ static void signalHandler(int sig, siginfo_t *siginfo, void *context) (void) sig; (void) siginfo; (void) context; - logError("signal handler was called, exit now..."); + logInfo("signal handler was called, signal",sig); gDispatchDone = 1; //todo: maually fire the mainloop CAmControlSender::CallsetControllerRundown(); - //todo: Maybe we can remove this here in a productive system. For now it's handy :-) - exit (-1); } void mainProgram() @@ -357,7 +355,6 @@ int main(int argc, char *argv[], char** envp) sigaction(SIGQUIT, &signalAction, NULL); sigaction(SIGTERM, &signalAction, NULL); sigaction(SIGHUP, &signalAction, NULL); - sigaction(SIGQUIT, &signalAction, NULL); struct sigaction signalChildAction; memset(&signalChildAction, '\0', sizeof(signalChildAction)); -- cgit v1.2.1