ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
dd65c9
From d5a96e0d5fccfa2f0c31df4ef5637717acd1fa9d Mon Sep 17 00:00:00 2001
de541a
From: Lennart Poettering <lennart@poettering.net>
de541a
Date: Mon, 2 Nov 2015 23:13:01 +0100
de541a
Subject: [PATCH] journalctl: continue operation, even if we run into an
de541a
 invalid file
de541a
de541a
(cherry picked from commit 4f52b822b05c373f40fea1a41ae3ade5d5ff558e)
de541a
de541a
Related: #1465759
de541a
---
de541a
 src/journal/journalctl.c | 7 ++-----
de541a
 1 file changed, 2 insertions(+), 5 deletions(-)
de541a
de541a
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
de541a
index c771cff8b..8c8379732 100644
de541a
--- a/src/journal/journalctl.c
de541a
+++ b/src/journal/journalctl.c
de541a
@@ -1804,15 +1804,12 @@ static int access_check(sd_journal *j) {
de541a
         SET_FOREACH(code, j->errors, it) {
de541a
                 int err;
de541a
 
de541a
-                err = -PTR_TO_INT(code);
de541a
-                assert(err > 0);
de541a
+                err = abs(PTR_TO_INT(code));
de541a
 
de541a
                 if (err == EACCES)
de541a
                         continue;
de541a
 
de541a
-                log_warning_errno(err, "Error was encountered while opening journal files: %m");
de541a
-                if (r == 0)
de541a
-                        r = -err;
de541a
+                log_warning_errno(err, "An error was encountered while opening journal files, ignoring: %m");
de541a
         }
de541a
 
de541a
         return r;