diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-11-09 11:06:14 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-11-09 11:06:14 +0100 |
commit | ca69be0df85ac461824ff06eda61669d7741ca4f (patch) | |
tree | 607fb84953af65135109d47dfb8ad19472027fae /src | |
parent | d8d3f8d838ef4656c2f786c2316577f202827dbf (diff) | |
parent | bff039d2e6d0d721447335311f83c5e9ff50d528 (diff) | |
download | abrt-ca69be0df85ac461824ff06eda61669d7741ca4f.tar.gz abrt-ca69be0df85ac461824ff06eda61669d7741ca4f.tar.xz abrt-ca69be0df85ac461824ff06eda61669d7741ca4f.zip |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src')
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 2 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerSocket.cpp | 12 | ||||
-rw-r--r-- | src/Daemon/CrashWatcher.cpp | 28 | ||||
-rw-r--r-- | src/Daemon/Daemon.cpp | 6 | ||||
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 26 | ||||
-rw-r--r-- | src/Daemon/PluginManager.cpp | 5 | ||||
-rw-r--r-- | src/Hooks/CCpp.cpp | 2 |
7 files changed, 37 insertions, 44 deletions
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 925844e9..ed7e3858 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -286,7 +286,7 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply) 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); diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp index 7afe4b6e..ee775c6d 100644 --- a/src/Daemon/CommLayerServerSocket.cpp +++ b/src/Daemon/CommLayerServerSocket.cpp @@ -26,7 +26,7 @@ void CCommLayerServerSocket::Send(const std::string& pData, GIOChannel *pDestina ret = g_io_channel_write_chars(pDestination, message + offset, strlen(message + offset), &len, &err); if (ret == G_IO_STATUS_ERROR) { - warn_client("Error during sending data."); + error_msg("Error during sending data"); } } @@ -72,7 +72,7 @@ gboolean CCommLayerServerSocket::client_socket_cb(GIOChannel *source, GIOConditi ret = g_io_channel_read_chars(source, buff, 1, &len, &err); if (ret == G_IO_STATUS_ERROR) { - warn_client(std::string("Error while reading data from client socket: ") + err->message); + error_msg("Error while reading data from client socket: %s", err->message); return FALSE; } message += buff[0]; @@ -101,13 +101,13 @@ gboolean CCommLayerServerSocket::server_socket_cb(GIOChannel *source, GIOConditi condition & G_IO_ERR || condition & G_IO_NVAL) { - warn_client("Server socket error."); + error_msg("Server socket error"); return FALSE; } if ((socket = accept(serverSocket->m_nSocket, (struct sockaddr *)&remote, &len)) == -1) { - warn_client("Server can not accept client."); + error_msg("Server can not accept client"); return TRUE; } log("New socket client connected"); @@ -117,7 +117,7 @@ gboolean CCommLayerServerSocket::server_socket_cb(GIOChannel *source, GIOConditi static_cast<GIOFunc>(client_socket_cb), data)) { - warn_client("Can not init g_io_channel."); + error_msg("Can not init g_io_channel"); return TRUE; } serverSocket->m_mapClientChannels[socket] = gSocket; @@ -157,7 +157,7 @@ void CCommLayerServerSocket::ProcessMessage(const std::string& pMessage, GIOChan } else { - warn_client("Received unknown message type."); + error_msg("Received unknown message type"); } } diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index aa863505..e684277c 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -58,23 +58,23 @@ vector_crash_infos_t GetCrashInfos(const char *pUID) { mw_result_t res; map_crash_info_t info; + const char *uuid = UUIDsUIDs[ii].first.c_str(); + const char *uid = UUIDsUIDs[ii].second.c_str(); - res = GetCrashInfo(UUIDsUIDs[ii].first.c_str(), UUIDsUIDs[ii].second.c_str(), info); + res = GetCrashInfo(uuid, uid, info); switch (res) { case MW_OK: retval.push_back(info); break; case MW_ERROR: - warn_client("Can not find debug dump directory for UUID: " + UUIDsUIDs[ii].first + ", deleting from database"); - update_client("Can not find debug dump directory for UUID: " + UUIDsUIDs[ii].first + ", deleting from database"); - DeleteCrashInfo(UUIDsUIDs[ii].first.c_str(), UUIDsUIDs[ii].second.c_str()); + error_msg("Can't find dump directory for UUID %s, deleting from database", uuid); + DeleteCrashInfo(uuid, uid); break; case MW_FILE_ERROR: + error_msg("Can't open file in dump directory for UUID %s, deleting", uuid); { - warn_client("Can not open file in debug dump directory for UUID: " + UUIDsUIDs[ii].first + ", deleting"); - update_client("Can not open file in debug dump directory for UUID: " + UUIDsUIDs[ii].first + ", deleting"); - std::string debugDumpDir = DeleteCrashInfo(UUIDsUIDs[ii].first.c_str(), UUIDsUIDs[ii].second.c_str()); + std::string debugDumpDir = DeleteCrashInfo(uuid, uid); DeleteDebugDumpDir(debugDumpDir.c_str()); } break; @@ -89,8 +89,7 @@ vector_crash_infos_t GetCrashInfos(const char *pUID) { throw e; } - warn_client(e.what()); - update_client(e.what()); + error_msg("%s", e.what()); } //retval = GetCrashInfos(pUID); @@ -123,15 +122,15 @@ map_crash_report_t GetJobResult(const char* pUUID, const char* pUID, int force) case MW_OK: break; case MW_IN_DB_ERROR: - warn_client(std::string("Did not find crash with UUID ") + pUUID + " in database"); + error_msg("Can't find crash with UUID %s in database", pUUID); break; case MW_PLUGIN_ERROR: - warn_client("Particular analyzer plugin isn't loaded or there is an error within plugin(s)"); + error_msg("Particular analyzer plugin isn't loaded or there is an error within plugin(s)"); break; case MW_CORRUPTED: case MW_FILE_ERROR: default: - warn_client(std::string("Corrupted crash with UUID ") + pUUID + ", deleting"); + error_msg("Corrupted crash with UUID %s, deleting", pUUID); std::string debugDumpDir = DeleteCrashInfo(pUUID, pUID); DeleteDebugDumpDir(debugDumpDir.c_str()); break; @@ -162,7 +161,7 @@ static void* create_report(void* arg) } catch (CABRTException& e) { - warn_client(e.what()); + error_msg("%s", e.what()); } catch (...) {} set_client_name(NULL); @@ -220,8 +219,7 @@ bool DeleteDebugDump(const char *pUUID, const char *pUID) { throw e; } - warn_client(e.what()); - update_client(e.what()); + error_msg("%s", e.what()); return false; } return true; diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index b417cfd4..67e72cca 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -415,7 +415,7 @@ static void FindNewDumps(const char* pPath) { throw e; } - error_msg("%s", e.what().c_str()); + error_msg("%s", e.what()); } } } @@ -572,7 +572,7 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin } catch (CABRTException& e) { - warn_client(e.what()); + error_msg(e.what()); if (e.type() == EXCEP_FATAL) { free(buf); @@ -883,7 +883,7 @@ int main(int argc, char** argv) } catch (CABRTException& e) { - error_msg("Error: %s", e.what().c_str()); + error_msg("Error: %s", e.what()); } catch (std::exception& e) { diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index abf13814..6a635642 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -191,7 +191,7 @@ mw_result_t CreateCrashReport(const char *pUUID, } if (pUUID[0] == '\0' || row.m_sUUID != pUUID) { - warn_client(ssprintf("CreateCrashReport(): UUID '%s' is not in database", pUUID)); + error_msg("UUID '%s' is not in database", pUUID); return MW_IN_DB_ERROR; } @@ -236,7 +236,7 @@ mw_result_t CreateCrashReport(const char *pUUID, } catch (CABRTException& e) { - warn_client("CreateCrashReport(): " + e.what()); + error_msg("%s", e.what()); if (e.type() == EXCEP_DD_OPEN) { return MW_ERROR; @@ -266,8 +266,7 @@ void RunAction(const char *pActionDir, } catch (CABRTException& e) { - warn_client(ssprintf("RunAction(): %s", e.what().c_str())); - update_client(ssprintf("Execution of '%s' was not successful: %s", pPluginName, e.what().c_str())); + error_msg("Execution of '%s' was not successful: %s", pPluginName, e.what()); } } @@ -295,8 +294,7 @@ void RunActionsAndReporters(const char *pDebugDumpDir) } catch (CABRTException& e) { - warn_client("RunActionsAndReporters(): " + e.what()); - update_client("Activation of plugin '" + it_ar->first + "' was not successful: " + e.what()); + error_msg("Activation of plugin '%s' was not successful: %s", it_ar->first.c_str(), e.what()); } } } @@ -435,8 +433,7 @@ report_status_t Report(const map_crash_report_t& pCrashReport, { ret[pluginName].push_back("0"); ret[pluginName].push_back(e.what()); - warn_client("Report(): " + e.what()); - update_client("Reporting via '" + pluginName + "' was not successful: " + e.what()); + update_client("Reporting via %s' was not successful: %s", pluginName.c_str(), e.what()); } } } @@ -565,7 +562,7 @@ static mw_result_t SavePackageDescriptionToDebugDump(const char *pExecutable, } catch (CABRTException& e) { - warn_client("SavePackageDescriptionToDebugDump(): " + e.what()); + error_msg("%s", e.what()); if (e.type() == EXCEP_DD_SAVE) { return MW_FILE_ERROR; @@ -601,8 +598,7 @@ static void RunAnalyzerActions(const char *pAnalyzer, const char *pDebugDumpDir) } catch (CABRTException& e) { - warn_client("RunAnalyzerActions(): " + e.what()); - update_client("Action performed by '" + pluginName + "' was not successful: " + e.what()); + update_client("Action performed by '%s' was not successful: %s", pluginName.c_str(), e.what()); } } } @@ -684,7 +680,7 @@ mw_result_t SaveDebugDump(const char *pDebugDumpDir, } catch (CABRTException& e) { - warn_client("SaveDebugDump(): " + e.what()); + error_msg("%s", e.what()); if (e.type() == EXCEP_DD_SAVE) { return MW_FILE_ERROR; @@ -708,8 +704,8 @@ mw_result_t SaveDebugDump(const char *pDebugDumpDir, } mw_result_t GetCrashInfo(const char *pUUID, - const char *pUID, - map_crash_info_t& pCrashInfo) + const char *pUID, + map_crash_info_t& pCrashInfo) { pCrashInfo.clear(); CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase); @@ -734,7 +730,7 @@ mw_result_t GetCrashInfo(const char *pUUID, } catch (CABRTException& e) { - warn_client("GetCrashInfo(): " + e.what()); + error_msg("%s", e.what()); if (e.type() == EXCEP_DD_LOAD) { return MW_FILE_ERROR; diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 2363308a..5b871515 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -179,8 +179,7 @@ void CPluginManager::LoadPlugin(const std::string& pName) catch (CABRTException& e) { delete abrtPlugin; - warn_client("CPluginManager::LoadPlugin(): " + e.what()); - warn_client("Failed to load plugin " + pName); + error_msg("Failed to load plugin %s: %s", pName.c_str(), e.what()); } } } @@ -218,7 +217,7 @@ void CPluginManager::RegisterPlugin(const std::string& pName) log("Can't initialize plugin %s(%s): %s", pName.c_str(), plugin_type_str[abrt_plugin->second->GetType()], - e.what().c_str() + e.what() ); UnLoadPlugin(pName); return; diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp index 4e0dc719..0f95d05b 100644 --- a/src/Hooks/CCpp.cpp +++ b/src/Hooks/CCpp.cpp @@ -221,7 +221,7 @@ int main(int argc, char** argv) } catch (CABRTException& e) { - error_msg_and_die("%s", e.what().c_str()); + error_msg_and_die("%s", e.what()); } catch (std::exception& e) { |