chiark / gitweb /
log: fix error codes handling in catalog_list_items
[elogind.git] / src / journal / catalog.c
index dacf5c50a197cb608e07877f63421e222706846c..6b195f6920a16de5418cfdbfe883c6d7ea455fc2 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;