diff options
Diffstat (limited to 'src/Daemon/CommLayerServerDBus.cpp')
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 2483942d..ed7e3858 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -46,16 +46,24 @@ static void send_flush_and_unref(DBusMessage* msg) } /* Notify the clients (UI) about a new crash */ -void CCommLayerServerDBus::Crash(const std::string& progname, const std::string& uid) +void CCommLayerServerDBus::Crash(const char *progname, const char *uid_str) { DBusMessage* msg = new_signal_msg("Crash"); - const char* c_progname = progname.c_str(); - const char* c_uid = uid.c_str(); - dbus_message_append_args(msg, - DBUS_TYPE_STRING, &c_progname, - DBUS_TYPE_STRING, &c_uid, - DBUS_TYPE_INVALID); - VERB2 log("Sending signal Crash('%s','%s')", c_progname, c_uid); + if (uid_str) + { + dbus_message_append_args(msg, + DBUS_TYPE_STRING, &progname, + DBUS_TYPE_STRING, &uid_str, + DBUS_TYPE_INVALID); + VERB2 log("Sending signal Crash('%s','%s')", progname, uid_str); + } + else + { + dbus_message_append_args(msg, + DBUS_TYPE_STRING, &progname, + DBUS_TYPE_INVALID); + VERB2 log("Sending signal Crash('%s')", progname); + } send_flush_and_unref(msg); } @@ -127,7 +135,7 @@ static long get_remote_uid(DBusMessage* call, const char** ppSender = NULL) static int handle_GetCrashInfos(DBusMessage* call, DBusMessage* reply) { long unix_uid = get_remote_uid(call); - vector_crash_infos_t argout1 = GetCrashInfos(to_string(unix_uid)); + vector_crash_infos_t argout1 = GetCrashInfos(to_string(unix_uid).c_str()); DBusMessageIter iter; dbus_message_iter_init_append(reply, &iter); @@ -273,12 +281,12 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply) report_status_t argout1; try { - argout1 = Report(argin1, user_conf_data, to_string(unix_uid)); + argout1 = Report(argin1, user_conf_data, to_string(unix_uid).c_str()); } catch (CABRTException &e) { dbus_message_unref(reply); - reply = dbus_message_new_error(call, DBUS_ERROR_FAILED, e.what().c_str()); + reply = dbus_message_new_error(call, DBUS_ERROR_FAILED, e.what()); if (!reply) die_out_of_memory(); send_flush_and_unref(reply); @@ -307,7 +315,7 @@ static int handle_DeleteDebugDump(DBusMessage* call, DBusMessage* reply) } long unix_uid = get_remote_uid(call); - bool argout1 = DeleteDebugDump(argin1, to_string(unix_uid)); + bool argout1 = DeleteDebugDump(argin1, to_string(unix_uid).c_str()); dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &argout1, |