summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2016-08-26 08:51:13 -0700
committerLennart Poettering <lennart@poettering.net>2016-08-26 17:51:13 +0200
commit6431c7e216ceb9f3cfe073c94a47ac413b892e55 (patch)
tree64ab19702cf3f4f6519e144975f089c5ea9be6fa /src
parent23cabb68acac12f4e17332f6b5696c8f7ac52d62 (diff)
journal: add/use flushed_flag_is_set() helper (#4041)
Minor cleanup suggested by Lennart.
Diffstat (limited to 'src')
-rw-r--r--src/journal/journald-server.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index ca47d64fe0..3507910919 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -267,6 +267,10 @@ static int open_journal(
return r;
}
+static bool flushed_flag_is_set(void) {
+ return (access("/run/systemd/journal/flushed", F_OK) >= 0);
+}
+
static int system_journal_open(Server *s, bool flush_requested) {
bool flushed = false;
const char *fn;
@@ -274,8 +278,7 @@ static int system_journal_open(Server *s, bool flush_requested) {
if (!s->system_journal &&
(s->storage == STORAGE_PERSISTENT || s->storage == STORAGE_AUTO) &&
- (flush_requested
- || (flushed = (access("/run/systemd/journal/flushed", F_OK) >= 0)))) {
+ (flush_requested || (flushed = flushed_flag_is_set()))) {
/* If in auto mode: first try to create the machine
* path, but not the prefix.