From 23c6702959b763f6abbc3c853676c6aeedd6d3fe Mon Sep 17 00:00:00 2001 From: Matej Habrnal Date: Mon, 13 Jul 2015 11:25:17 +0200 Subject: [PATCH] a-dump-oops: allow update the problem, if more then one oops found In case that found more than one oops process the first one. Without this patch the script exits with error in this case because expects only one oops. Related to rhbz#1170534 Signed-off-by: Matej Habrnal --- src/plugins/abrt-dump-oops.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c index 58650cb..a348923 100644 --- a/src/plugins/abrt-dump-oops.c +++ b/src/plugins/abrt-dump-oops.c @@ -172,6 +172,17 @@ int main(int argc, char **argv) log("Updating problem directory"); switch (g_list_length(oops_list)) { + case 0: + { + error_msg(_("Can't update the problem: no oops found")); + errors = 1; + break; + } + default: + { + log_notice(_("More oopses found: process only the first one")); + } + /* falls trought */ case 1: { struct dump_dir *dd = dd_opendir(problem_dir, /*open for writing*/0); @@ -181,11 +192,6 @@ int main(int argc, char **argv) dd_close(dd); } } - break; - default: - error_msg(_("Can't update the problem: more than one oops found")); - errors = 1; - break; } } else -- 2.4.3