doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

Blame SOURCES/0136-cli-exit-with-the-number-of-unreported-problems.patch

a60cd7
From 7cd921326a2cdba7fa268cd373477149b7118bff Mon Sep 17 00:00:00 2001
a60cd7
From: Jakub Filak <jfilak@redhat.com>
a60cd7
Date: Thu, 4 Jun 2015 10:22:33 +0200
a60cd7
Subject: [PATCH] cli: exit with the number of unreported problems
a60cd7
a60cd7
This patch fixes the broken cli-sanity.
a60cd7
a60cd7
Related: #1224984
a60cd7
a60cd7
Signed-off-by: Jakub Filak <jfilak@redhat.com>
a60cd7
---
a60cd7
 src/cli/report.c | 5 ++++-
a60cd7
 1 file changed, 4 insertions(+), 1 deletion(-)
a60cd7
a60cd7
diff --git a/src/cli/report.c b/src/cli/report.c
a60cd7
index 6af9769..194f7c9 100644
a60cd7
--- a/src/cli/report.c
a60cd7
+++ b/src/cli/report.c
a60cd7
@@ -50,6 +50,7 @@ int cmd_report(int argc, const char **argv)
a60cd7
     load_abrt_conf();
a60cd7
     free_abrt_conf_data();
a60cd7
 
a60cd7
+    int ret = 0;
a60cd7
     while (*argv)
a60cd7
     {
a60cd7
         const char *dir_name = *argv++;
a60cd7
@@ -57,6 +58,7 @@ int cmd_report(int argc, const char **argv)
a60cd7
         if (real_problem_id == NULL)
a60cd7
         {
a60cd7
             error_msg(_("Can't find problem '%s'"), dir_name);
a60cd7
+            ++ret;
a60cd7
             continue;
a60cd7
         }
a60cd7
 
a60cd7
@@ -65,6 +67,7 @@ int cmd_report(int argc, const char **argv)
a60cd7
         {
a60cd7
             error_msg(_("Can't take ownership of '%s'"), real_problem_id);
a60cd7
             free(real_problem_id);
a60cd7
+            ++ret;
a60cd7
             continue;
a60cd7
         }
a60cd7
         int status = report_problem_in_dir(real_problem_id,
a60cd7
@@ -84,5 +87,5 @@ int cmd_report(int argc, const char **argv)
a60cd7
             exit(status);
a60cd7
     }
a60cd7
 
a60cd7
-    return 0;
a60cd7
+    return ret;
a60cd7
 }
a60cd7
-- 
a60cd7
2.4.3
a60cd7