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

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