ryantimwilson / rpms / systemd

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