summaryrefslogtreecommitdiffstats
path: root/src/Daemon/MiddleWare.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-05 16:06:41 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-05 16:06:41 +0100
commit3eb31571804247a6ba51349f5a78ad7a334d3e7e (patch)
tree7e4c09331bb6aa16c0a2de2e4bca286871cf1d9c /src/Daemon/MiddleWare.cpp
parent75c6e1fc1113984b30a4d84c1cfe6e97c70c398f (diff)
downloadabrt-3eb31571804247a6ba51349f5a78ad7a334d3e7e.tar.gz
abrt-3eb31571804247a6ba51349f5a78ad7a334d3e7e.tar.xz
abrt-3eb31571804247a6ba51349f5a78ad7a334d3e7e.zip
abrtd: fix handling of dupes (weren't deleting dup's directory); better logging
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Daemon/MiddleWare.cpp')
-rw-r--r--src/Daemon/MiddleWare.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp
index c3f9061a..ebd5c0fc 100644
--- a/src/Daemon/MiddleWare.cpp
+++ b/src/Daemon/MiddleWare.cpp
@@ -702,10 +702,6 @@ static mw_result_t SavePackageDescriptionToDebugDump(
catch (CABRTException& e)
{
error_msg("%s", e.what());
- if (e.type() == EXCEP_DD_SAVE)
- {
- return MW_FILE_ERROR;
- }
return MW_ERROR;
}
@@ -832,15 +828,16 @@ static mw_result_t SaveDebugDumpToDatabase(const char *pUUID,
mw_result_t res = FillCrashInfo(pUUID, pUID, pCrashData);
if (res == MW_OK)
{
+ const char *first = get_crash_data_item_content(pCrashData, CD_DUMPDIR).c_str();
if (row.m_sReported == "1")
{
- log("Crash is already reported");
+ log("Crash is in database already (dup of %s) and is reported", first);
return MW_REPORTED;
}
if (row.m_sCount != "1")
{
- log("Crash is in database already");
- return MW_OCCURED;
+ log("Crash is in database already (dup of %s)", first);
+ return MW_OCCURRED;
}
}
return res;
@@ -876,10 +873,6 @@ mw_result_t SaveDebugDump(const char *pDebugDumpDir,
catch (CABRTException& e)
{
error_msg("%s", e.what());
- if (e.type() == EXCEP_DD_SAVE)
- {
- return MW_FILE_ERROR;
- }
return MW_ERROR;
}
@@ -898,6 +891,13 @@ mw_result_t SaveDebugDump(const char *pDebugDumpDir,
const char *uid_str = analyzer_has_InformAllUsers(analyzer.c_str())
? "-1"
: UID.c_str();
+ /* Loads pCrashData (from the *first debugdump dir* if this one is a dup)
+ * Returns:
+ * MW_REPORTED: "the crash is flagged as reported in DB" (which also means it's a dup)
+ * MW_OCCURRED: "crash count is != 1" (iow: it is > 1 - dup)
+ * MW_OK: "crash count is 1" (iow: this is a new crash, not a dup)
+ * else: an error code
+ */
return SaveDebugDumpToDatabase(lUUID.c_str(), uid_str, time.c_str(), pDebugDumpDir, pCrashData);
}