Blame SOURCES/0133-cli-status-don-t-return-0-if-there-is-a-problem-olde.patch

baab13
From ff8155d284dac74ae776d08de064e1cea17675be Mon Sep 17 00:00:00 2001
baab13
From: Jakub Filak <jfilak@redhat.com>
baab13
Date: Wed, 8 Apr 2015 09:47:08 +0200
baab13
Subject: [PATCH] cli-status: don't return 0 if there is a problem older than
baab13
 limit
baab13
baab13
The loop should skip such a problem and not return from the counting
baab13
function with 0. This is an obvious bug introduced in
baab13
commit 58d8e83f58afb32db3bdfd5170e65dc0ef2d2ce0
baab13
baab13
Related: #1224984
baab13
baab13
Signed-off-by: Jakub Filak <jfilak@redhat.com>
baab13
---
baab13
 src/cli/status.c | 11 ++++++++++-
baab13
 1 file changed, 10 insertions(+), 1 deletion(-)
baab13
baab13
diff --git a/src/cli/status.c b/src/cli/status.c
baab13
index 68bdd0e..a65ba05 100644
baab13
--- a/src/cli/status.c
baab13
+++ b/src/cli/status.c
baab13
@@ -30,16 +30,25 @@ static unsigned int count_problem_dirs(unsigned long since)
baab13
     {
baab13
         const char *problem_id = (const char *)iter->data;
baab13
         if (test_exist_over_dbus(problem_id, FILENAME_REPORTED_TO))
baab13
+        {
baab13
+            log_debug("Not counting problem %s: already reported", problem_id);
baab13
             continue;
baab13
+        }
baab13
 
baab13
         char *time_str = load_text_over_dbus(problem_id, FILENAME_LAST_OCCURRENCE);
baab13
         if (time_str == NULL)
baab13
+        {
baab13
+            log_debug("Not counting problem %s: failed to get time element", problem_id);
baab13
             continue;
baab13
+        }
baab13
 
baab13
         long val = atol(time_str);
baab13
         free(time_str);
baab13
         if (val < since)
baab13
-            return 0;
baab13
+        {
baab13
+            log_debug("Not counting problem %s: older tham limit (%ld < %ld)", problem_id, val, since);
baab13
+            continue;
baab13
+        }
baab13
 
baab13
         count++;
baab13
     }
baab13
-- 
baab13
2.4.3
baab13