From fe34bea3225ddf49f4611299af7b54c6ac60fbb6 Mon Sep 17 00:00:00 2001 From: Nikola Pajkovsky Date: Wed, 22 Sep 2010 12:02:02 +0200 Subject: add two flags to dd_opendir() DD_CLOSE_ON_OPEN_ERR - free dump_dir structure when opening dump_dir does not exist DD_FAIL_QUIETLY - suppress message when dump directory does not exist VERB1 log(_("Unable to open debug dump '%s'"), pDebugDumpDir); is all removed because there is error_msg("'%s' does not exist", dd->dd_dir); in dd_opendir() which sometimes we don't want to print(DD_FAIL_QUIETLY) example: crash dump directory trimming code running concurrently. Second process may try to delete a directory which is already gone. it should not complain that it is missing. Signed-off-by: Nikola Pajkovsky Acked-off-by: Denys Vlasenko --- lib/plugins/SOSreport.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/plugins/SOSreport.cpp') diff --git a/lib/plugins/SOSreport.cpp b/lib/plugins/SOSreport.cpp index 280738d2..5c1b658a 100644 --- a/lib/plugins/SOSreport.cpp +++ b/lib/plugins/SOSreport.cpp @@ -51,12 +51,8 @@ void CActionSOSreport::Run(const char *pActionDir, const char *pArgs, int force) if (!force) { struct dump_dir *dd = dd_init(); - if (!dd_opendir(dd, pActionDir)) - { - dd_close(dd); - VERB1 log(_("Unable to open debug dump '%s'"), pActionDir); + if (!dd_opendir(dd, pActionDir, DD_CLOSE_ON_OPEN_ERR)) return; - } bool bt_exists = dd_exist(dd, "sosreport.tar.bz2") || dd_exist(dd, "sosreport.tar.xz"); if (bt_exists) -- cgit