Blob Blame Raw
From 3e2b4131453ffb0c76660d717413de238590056b Mon Sep 17 00:00:00 2001
From: Matej Habrnal <mhabrnal@redhat.com>
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 <mhabrnal@redhat.com>
---
 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 b1031ea..6f2f41b 100644
--- a/src/plugins/abrt-dump-oops.c
+++ b/src/plugins/abrt-dump-oops.c
@@ -171,6 +171,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);
@@ -180,11 +191,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