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

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