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

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