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

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