diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-09 19:04:42 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-09 19:04:42 +0200 |
commit | 39d77b6cfa633b94a31de5ec387949a7c7b85623 (patch) | |
tree | 37dbbb2f84ff2e8d524cdf8ece16401e8955d6dd /src | |
parent | 08ec5a72cd334fffc8aa343ab48f4b6d1c88e3a7 (diff) | |
download | abrt-39d77b6cfa633b94a31de5ec387949a7c7b85623.tar.gz abrt-39d77b6cfa633b94a31de5ec387949a7c7b85623.tar.xz abrt-39d77b6cfa633b94a31de5ec387949a7c7b85623.zip |
fix the bug where lock file was not removed
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 20 | ||||
-rw-r--r-- | src/Hooks/CCpp.cpp | 1 |
2 files changed, 6 insertions, 15 deletions
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 8c880b8..e3b6869 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -84,7 +84,6 @@ static void DebugDumpToCrashReport(const std::string& pDebugDumpDir, map_crash_r !dd.Exist(FILENAME_RELEASE) || !dd.Exist(FILENAME_EXECUTABLE)) { - dd.Close(); throw CABRTException(EXCEP_ERROR, "DebugDumpToCrashReport(): One or more of important file(s)'re missing."); } pCrashReport.clear(); @@ -126,7 +125,6 @@ static void DebugDumpToCrashReport(const std::string& pDebugDumpDir, map_crash_r } } } - dd.Close(); } /** @@ -189,9 +187,9 @@ mw_result_t CreateCrashReport(const std::string& pUUID, return MW_IN_DB_ERROR; } - CDebugDump dd; try { + CDebugDump dd; std::string analyzer; std::string gUUID; @@ -412,7 +410,6 @@ void DeleteDebugDumpDir(const std::string& pDebugDumpDir) CDebugDump dd; dd.Open(pDebugDumpDir); dd.Delete(); - dd.Close(); } std::string DeleteCrashInfo(const std::string& pUUID, @@ -514,21 +511,19 @@ static mw_result_t SavePackageDescriptionToDebugDump(const std::string& pExecuta std::string description = GetDescription(packageName); std::string component = GetComponent(pExecutable); - CDebugDump dd; try { + CDebugDump dd; dd.Open(pDebugDumpDir); dd.SaveText(FILENAME_PACKAGE, package); dd.SaveText(FILENAME_DESCRIPTION, description); dd.SaveText(FILENAME_COMPONENT, component); - dd.Close(); } catch (CABRTException& e) { warn_client("SavePackageDescriptionToDebugDump(): " + e.what()); if (e.type() == EXCEP_DD_SAVE) { - dd.Close(); return MW_FILE_ERROR; } return MW_ERROR; @@ -621,24 +616,22 @@ mw_result_t SaveDebugDump(const std::string& pDebugDumpDir, std::string time; std::string analyzer; std::string executable; - CDebugDump dd; mw_result_t res; try { + CDebugDump dd; dd.Open(pDebugDumpDir); dd.LoadText(FILENAME_TIME, time); dd.LoadText(FILENAME_UID, UID); dd.LoadText(FILENAME_ANALYZER, analyzer); dd.LoadText(FILENAME_EXECUTABLE, executable); - dd.Close(); } catch (CABRTException& e) { warn_client("SaveDebugDump(): " + e.what()); if (e.type() == EXCEP_DD_SAVE) { - dd.Close(); return MW_FILE_ERROR; } return MW_ERROR; @@ -648,7 +641,8 @@ mw_result_t SaveDebugDump(const std::string& pDebugDumpDir, { return MW_IN_DB; } - if ((res = SavePackageDescriptionToDebugDump(executable, pDebugDumpDir)) != MW_OK) + res = SavePackageDescriptionToDebugDump(executable, pDebugDumpDir); + if (res != MW_OK) { return res; } @@ -669,25 +663,23 @@ mw_result_t GetCrashInfo(const std::string& pUUID, row = database->GetUUIDData(pUUID, pUID); database->DisConnect(); - CDebugDump dd; std::string package; std::string executable; std::string description; try { + CDebugDump dd; dd.Open(row.m_sDebugDumpDir); dd.LoadText(FILENAME_EXECUTABLE, executable); dd.LoadText(FILENAME_PACKAGE, package); dd.LoadText(FILENAME_DESCRIPTION, description); - dd.Close(); } catch (CABRTException& e) { warn_client("GetCrashInfo(): " + e.what()); if (e.type() == EXCEP_DD_LOAD) { - dd.Close(); return MW_FILE_ERROR; } return MW_ERROR; diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp index d30a4a3..5bbdc8a 100644 --- a/src/Hooks/CCpp.cpp +++ b/src/Hooks/CCpp.cpp @@ -207,7 +207,6 @@ int main(int argc, char** argv) /* close(fd); - why bother? */ /* free(executable); */ /* free(cmdline); */ - dd.Close(); log("saved core dump of pid %u to %s", (int)pid, path); } catch (CABRTException& e) |