diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-01-25 15:05:36 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-01-25 22:12:30 +0100 |
commit | 6713ed7a63c032cf3592587e1746bccea1fc04bc (patch) | |
tree | a1c5efb9f693c9e3d1f57d82e034700f901a4d31 /src/journal | |
parent | ce92dc27a126a8076ee60913d5d2f43aaa2cd75b (diff) | |
download | systemd-6713ed7a63c032cf3592587e1746bccea1fc04bc.tar.gz |
journal: add some line breaks/comments
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/journald-server.c | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index f43d1b5609..dceb4cddb6 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -293,11 +293,11 @@ static int open_journal( metrics, s->mmap, s->deferred_closes, - NULL, + /* template= */ NULL, &f); else r = managed_journal_file_open( - -1, + /* fd= */ -1, fname, open_flags, file_flags, @@ -306,9 +306,8 @@ static int open_journal( metrics, s->mmap, s->deferred_closes, - NULL, + /* template= */ NULL, &f); - if (r < 0) return r; @@ -353,7 +352,14 @@ static int system_journal_open(Server *s, bool flush_requested, bool relinquish_ (void) mkdir(s->system_storage.path, 0755); fn = strjoina(s->system_storage.path, "/system.journal"); - r = open_journal(s, true, fn, O_RDWR|O_CREAT, s->seal, &s->system_storage.metrics, &s->system_journal); + r = open_journal( + s, + /* reliably= */ true, + fn, + O_RDWR|O_CREAT, + s->seal, + &s->system_storage.metrics, + &s->system_journal); if (r >= 0) { server_add_acls(s->system_journal, 0); (void) cache_space_refresh(s, &s->system_storage); @@ -383,11 +389,17 @@ static int system_journal_open(Server *s, bool flush_requested, bool relinquish_ if (s->system_journal && !relinquish_requested) { - /* Try to open the runtime journal, but only - * if it already exists, so that we can flush - * it into the system journal */ - - r = open_journal(s, false, fn, O_RDWR, false, &s->runtime_storage.metrics, &s->runtime_journal); + /* Try to open the runtime journal, but only if it already exists, so that we can + * flush it into the system journal */ + + r = open_journal( + s, + /* reliably= */ false, + fn, + O_RDWR, + /* seal= */ false, + &s->runtime_storage.metrics, + &s->runtime_journal); if (r < 0) { if (r != -ENOENT) log_ratelimit_warning_errno(r, JOURNAL_LOG_RATELIMIT, @@ -403,7 +415,14 @@ static int system_journal_open(Server *s, bool flush_requested, bool relinquish_ (void) mkdir_parents(s->runtime_storage.path, 0755); (void) mkdir(s->runtime_storage.path, 0750); - r = open_journal(s, true, fn, O_RDWR|O_CREAT, false, &s->runtime_storage.metrics, &s->runtime_journal); + r = open_journal( + s, + /* reliably= */ true, + fn, + O_RDWR|O_CREAT, + /* seal= */ false, + &s->runtime_storage.metrics, + &s->runtime_journal); if (r < 0) return log_ratelimit_warning_errno(r, JOURNAL_LOG_RATELIMIT, "Failed to open runtime journal: %m"); @@ -441,7 +460,14 @@ static int find_user_journal(Server *s, uid_t uid, ManagedJournalFile **ret) { (void) managed_journal_file_close(first); } - r = open_journal(s, true, p, O_RDWR|O_CREAT, s->seal, &s->system_storage.metrics, &f); + r = open_journal( + s, + /* reliably= */ true, + p, + O_RDWR|O_CREAT, + s->seal, + &s->system_storage.metrics, + &f); if (r < 0) return r; @@ -634,7 +660,7 @@ static int server_archive_offline_user_journals(Server *s) { &s->system_storage.metrics, s->mmap, s->deferred_closes, - NULL, + /* template= */ NULL, &f); if (r < 0) { log_ratelimit_warning_errno(r, JOURNAL_LOG_RATELIMIT, |