1ff636
From 5633544097b9c3bf3d63ef3be9e7db5d4e1f49dc Mon Sep 17 00:00:00 2001
1ff636
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
1ff636
Date: Sun, 8 Mar 2015 11:11:50 -0400
1ff636
Subject: [PATCH] sd-journal: return error when we cannot open a file
1ff636
1ff636
Lack of this caused journalctl not to display a hint about missing groups
1ff636
properly when the user lacks permissions.
1ff636
1ff636
(cherry picked from commit 7b300be75e6d5755778dd7da63e7147866f21351)
1ff636
---
1ff636
 src/journal/sd-journal.c | 2 +-
1ff636
 1 file changed, 1 insertion(+), 1 deletion(-)
1ff636
1ff636
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
c62b8e
index 9b57e5945d..9b9e8ac859 100644
1ff636
--- a/src/journal/sd-journal.c
1ff636
+++ b/src/journal/sd-journal.c
1ff636
@@ -1248,7 +1248,7 @@ static int add_file(sd_journal *j, const char *prefix, const char *filename) {
1ff636
         r = add_any_file(j, path);
1ff636
         if (r == -ENOENT)
1ff636
                 return 0;
1ff636
-        return 0;
1ff636
+        return r;
1ff636
 }
1ff636
 
1ff636
 static int remove_file(sd_journal *j, const char *prefix, const char *filename) {