diff options
author | Michal Toman <mtoman@redhat.com> | 2010-08-18 11:18:39 +0200 |
---|---|---|
committer | Michal Toman <mtoman@redhat.com> | 2010-08-18 11:18:39 +0200 |
commit | 4ef4bc1ba11d9c185db584ed97ce520a6306b462 (patch) | |
tree | 5b37f6ca52fd5911b7e65157b4246cc99d7f3fab /lib/plugins/SOSreport.cpp | |
parent | e0b0da307a78b038045e2cb86934d60befd74339 (diff) | |
download | abrt-4ef4bc1ba11d9c185db584ed97ce520a6306b462.tar.gz abrt-4ef4bc1ba11d9c185db584ed97ce520a6306b462.tar.xz abrt-4ef4bc1ba11d9c185db584ed97ce520a6306b462.zip |
get rid of exceptions in CDebugDump class
Diffstat (limited to 'lib/plugins/SOSreport.cpp')
-rw-r--r-- | lib/plugins/SOSreport.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/plugins/SOSreport.cpp b/lib/plugins/SOSreport.cpp index 6c8ab1f8..df254ec3 100644 --- a/lib/plugins/SOSreport.cpp +++ b/lib/plugins/SOSreport.cpp @@ -53,13 +53,19 @@ void CActionSOSreport::Run(const char *pActionDir, const char *pArgs, int force) if (!force) { CDebugDump dd; - dd.Open(pActionDir); + if (!dd.Open(pActionDir)) + { + VERB1 log(_("Unable to open debug dump '%s'"), pActionDir); + return; + } + bool bt_exists = dd.Exist("sosreport.tar.bz2") || dd.Exist("sosreport.tar.xz"); if (bt_exists) { VERB3 log("%s already exists, not regenerating", "sosreport.tar.bz2"); return; } + dd.Close(); } static const char command_default[] = @@ -125,7 +131,11 @@ void CActionSOSreport::Run(const char *pActionDir, const char *pArgs, int force) sosreport_dd_filename += ext; } CDebugDump dd; - dd.Open(pActionDir); + if (!dd.Open(pActionDir)) + { + VERB1 log(_("Unable to open debug dump '%s'"), pDebugDumpDir); + return; + } //Not useful: dd.SaveText("sosreportoutput", output); off_t sz = copy_file(sosreport_filename, sosreport_dd_filename.c_str(), 0644); |