summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-06-27 14:32:56 +0200
committerchristian mueller <christian.ei.mueller@bmw.de>2012-06-27 14:32:56 +0200
commit1a7a770ea57ac82244ae9c2f1e62c359b2f93098 (patch)
tree8b315c37d0f4777bdb37c4e2b76736375c7b0ea7
parent278c08ffaff6de6155bffa80cd5a25ac0807b745 (diff)
downloadaudiomanager-1a7a770ea57ac82244ae9c2f1e62c359b2f93098.tar.gz
* [GAM-65] seg faults when starting AudiManager as daemon. This is now totally fixed. The absolut path is handed over via cmake so the AudioManager can find the xmls to be loaded in daemon mode as well
Signed-off-by: christian mueller <christian.ei.mueller@bmw.de>
-rw-r--r--PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp6
-rw-r--r--PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp7
-rw-r--r--cmake/config.cmake2
3 files changed, 10 insertions, 5 deletions
diff --git a/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp b/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp
index 86ef443..2b411b3 100644
--- a/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp
+++ b/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp
@@ -344,10 +344,12 @@ void IAmCommandReceiverShadow::sendIntrospection(DBusConnection *conn, DBusMessa
// create a reply from the message
reply = dbus_message_new_method_return(msg);
- std::ifstream in("CommandInterface.xml", std::ifstream::in);
+ std::string fullpath(EXECUTABLE_OUTPUT_PATH);
+ fullpath.append("/CommandInterface.xml");
+ std::ifstream in(fullpath.c_str(), std::ifstream::in);
if (!in)
{
- logError("IAmCommandReceiverShadow::sendIntrospection could not load xml file");
+ logError("IAmCommandReceiverShadow::sendIntrospection could not load xml file ",fullpath);
throw std::runtime_error("IAmCommandReceiverShadow::sendIntrospection Could not load introspecton XML");
}
std::string introspect((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
diff --git a/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp b/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp
index e48e753..8759253 100644
--- a/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp
+++ b/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp
@@ -589,15 +589,16 @@ void IAmRoutingReceiverShadowDbus::sendIntrospection(DBusConnection* conn, DBusM
// create a reply from the message
reply = dbus_message_new_method_return(msg);
- std::ifstream in("RoutingReceiver.xml", std::ifstream::in);
+ std::string fullpath(EXECUTABLE_OUTPUT_PATH);
+ fullpath.append("/RoutingReceiver.xml");
+ std::ifstream in(fullpath.c_str(), std::ifstream::in);
if (!in)
{
- logError("IAmCommandReceiverShadow::sendIntrospection could not load xml file");
+ logError("IAmCommandReceiverShadow::sendIntrospection could not load xml file ",fullpath);
throw std::runtime_error("IAmCommandReceiverShadow::sendIntrospection Could not load introspecton XML");
}
std::string introspect((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
const char* string = introspect.c_str();
- log(&routingDbus, DLT_LOG_INFO, introspect.c_str());
// add the arguments to the reply
dbus_message_iter_init_append(reply, &args);
diff --git a/cmake/config.cmake b/cmake/config.cmake
index 4e65e3d..a8989e5 100644
--- a/cmake/config.cmake
+++ b/cmake/config.cmake
@@ -20,4 +20,6 @@
#cmakedefine DBUS_SERVICE_PREFIX "@DBUS_SERVICE_PREFIX@"
#cmakedefine DBUS_SERVICE_OBJECT_PATH "@DBUS_SERVICE_OBJECT_PATH@"
+#cmakedefine EXECUTABLE_OUTPUT_PATH "@EXECUTABLE_OUTPUT_PATH@"
+
#endif /* _CONFIG_H */