chiark / gitweb /
log: fix error codes handling in catalog_list_items
authorLukas Nykryn <lnykryn@redhat.com>
Wed, 27 Mar 2013 09:44:21 +0000 (10:44 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 27 Mar 2013 16:01:44 +0000 (12:01 -0400)
It does not make sense to print error code from previous loop.

src/journal/catalog.c

index dacf5c5..6b195f6 100644 (file)
@@ -616,7 +616,7 @@ int catalog_list_items(FILE *f, bool oneline, char **items) {
                 k = sd_id128_from_string(*item, &id);
                 if (k < 0) {
                         log_error("Failed to parse id128 '%s': %s",
-                                  *item, strerror(-r));
+                                  *item, strerror(-k));
                         if (r < 0)
                                 r = k;
                         continue;
@@ -626,7 +626,7 @@ int catalog_list_items(FILE *f, bool oneline, char **items) {
                 if (k < 0) {
                         log_full(k == -ENOENT ? LOG_NOTICE : LOG_ERR,
                                  "Failed to retrieve catalog entry for '%s': %s",
-                                  *item, strerror(-r));
+                                  *item, strerror(-k));
                         if (r < 0)
                                 r = k;
                         continue;