[systemd-devel] [PATCH] catalog: fix error codes handling in catalog_list_items

Lukas Nykryn lnykryn at redhat.com
Wed Mar 27 09:35:55 PDT 2013


Previously r was set to zero and so if(r<0) was never true.
---
 src/journal/catalog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/journal/catalog.c b/src/journal/catalog.c
index 6b195f6..7ae7b3e 100644
--- a/src/journal/catalog.c
+++ b/src/journal/catalog.c
@@ -617,7 +617,7 @@ int catalog_list_items(FILE *f, bool oneline, char **items) {
                 if (k < 0) {
                         log_error("Failed to parse id128 '%s': %s",
                                   *item, strerror(-k));
-                        if (r < 0)
+                        if (r == 0)
                                 r = k;
                         continue;
                 }
@@ -627,7 +627,7 @@ int catalog_list_items(FILE *f, bool oneline, char **items) {
                         log_full(k == -ENOENT ? LOG_NOTICE : LOG_ERR,
                                  "Failed to retrieve catalog entry for '%s': %s",
                                   *item, strerror(-k));
-                        if (r < 0)
+                        if (r == 0)
                                 r = k;
                         continue;
                 }
-- 
1.8.1.4



More information about the systemd-devel mailing list