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