teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Blob Blame History Raw
From f5a2a7b3630d0ba9a25f8a81cdeaf5336b745e3e Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 2 Nov 2015 23:13:01 +0100
Subject: [PATCH] journalctl: continue operation, even if we run into an
 invalid file

(cherry picked from commit 4f52b822b05c373f40fea1a41ae3ade5d5ff558e)

Related: #1465759
---
 src/journal/journalctl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index c771cff8b..8c8379732 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -1804,15 +1804,12 @@ static int access_check(sd_journal *j) {
         SET_FOREACH(code, j->errors, it) {
                 int err;
 
-                err = -PTR_TO_INT(code);
-                assert(err > 0);
+                err = abs(PTR_TO_INT(code));
 
                 if (err == EACCES)
                         continue;
 
-                log_warning_errno(err, "Error was encountered while opening journal files: %m");
-                if (r == 0)
-                        r = -err;
+                log_warning_errno(err, "An error was encountered while opening journal files, ignoring: %m");
         }
 
         return r;