diff options
author | christian linke <christian.linke@bmw.de> | 2012-10-16 19:31:43 +0200 |
---|---|---|
committer | christian linke <christian.linke@bmw.de> | 2012-10-16 19:31:43 +0200 |
commit | 9d35fa935becc285c5518b198628615d35ea6b74 (patch) | |
tree | 2c4676b70f28976d9f4d9ae25c1e75489bc3e8f2 | |
parent | f7f41830ddadd4ffda7ca68a2ae6020ac61c95de (diff) | |
download | audiomanager-9d35fa935becc285c5518b198628615d35ea6b74.tar.gz |
* nicer handling of singal for exit.
Signed-off-by: christian linke <christian.linke@bmw.de>
-rw-r--r-- | AudioManagerDaemon/src/CAmControlReceiver.cpp | 4 | ||||
-rwxr-xr-x | AudioManagerDaemon/src/main.cpp | 5 | ||||
-rw-r--r-- | PluginControlInterface/src/CAmControlSenderBase.cpp | 2 |
3 files changed, 7 insertions, 4 deletions
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 <cassert> +#include <stdlib.h> #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)); diff --git a/PluginControlInterface/src/CAmControlSenderBase.cpp b/PluginControlInterface/src/CAmControlSenderBase.cpp index 2878306..3e0c65b 100644 --- a/PluginControlInterface/src/CAmControlSenderBase.cpp +++ b/PluginControlInterface/src/CAmControlSenderBase.cpp @@ -558,6 +558,8 @@ void CAmControlSenderBase::cbAckSetSinkSoundProperties(const am_Handle_s handle, void CAmControlSenderBase::setControllerRundown() { + logInfo("CAmControlSenderBase::setControllerRundown() was called"); + mControlReceiveInterface->confirmControllerRundown(); } am_Error_e CAmControlSenderBase::getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector<am_ConnectionFormat_e> listPossibleConnectionFormats, std::vector<am_ConnectionFormat_e> & listPrioConnectionFormats) |