代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From ceacf935ac9f59bc08b5901f70f227958a2bcf52 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Tue, 28 May 2019 18:07:01 +0900
Subject: [PATCH] journal: use cleanup attribute at one more place
(cherry picked from commit 627df1dc42b68a74b0882b06366d1185b1a34332)
Conflicts:
src/journal/journald-server.c
Related: #1788085
---
src/journal/journal-file.h | 1 +
src/journal/journald-server.c | 9 ++++-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index cd8a48a364..6a44fd39d2 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -144,6 +144,7 @@ int journal_file_open(
int journal_file_set_offline(JournalFile *f, bool wait);
bool journal_file_is_offlining(JournalFile *f);
JournalFile* journal_file_close(JournalFile *j);
+DEFINE_TRIVIAL_CLEANUP_FUNC(JournalFile*, journal_file_close);
int journal_file_open_reliably(
const char *fname,
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 6250eab831..7632e2d9d0 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -253,8 +253,9 @@ static int open_journal(
bool seal,
JournalMetrics *metrics,
JournalFile **ret) {
+
+ _cleanup_(journal_file_closep) JournalFile *f = NULL;
int r;
- JournalFile *f;
assert(s);
assert(fname);
@@ -271,12 +272,10 @@ static int open_journal(
return r;
r = journal_file_enable_post_change_timer(f, s->event, POST_CHANGE_TIMER_INTERVAL_USEC);
- if (r < 0) {
- (void) journal_file_close(f);
+ if (r < 0)
return r;
- }
- *ret = f;
+ *ret = TAKE_PTR(f);
return r;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。