From: Lennart Poettering Date: Mon, 16 Jan 2023 13:06:23 +0000 (+0100) Subject: journal: use compound initializors at one more place X-Git-Tag: v253-rc1~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f30a67a7a9a51212ff639326a67fdfdc9319e61;p=thirdparty%2Fsystemd.git journal: use compound initializors at one more place --- diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c index ac8ca0f54b4..035d7ccef82 100644 --- a/src/libsystemd/sd-journal/sd-journal.c +++ b/src/libsystemd/sd-journal/sd-journal.c @@ -1874,15 +1874,17 @@ static int allocate_inotify(sd_journal *j) { static sd_journal *journal_new(int flags, const char *path, const char *namespace) { _cleanup_(sd_journal_closep) sd_journal *j = NULL; - j = new0(sd_journal, 1); + j = new(sd_journal, 1); if (!j) return NULL; - j->original_pid = getpid_cached(); - j->toplevel_fd = -EBADF; - j->inotify_fd = -EBADF; - j->flags = flags; - j->data_threshold = DEFAULT_DATA_THRESHOLD; + *j = (sd_journal) { + .original_pid = getpid_cached(), + .toplevel_fd = -EBADF, + .inotify_fd = -EBADF, + .flags = flags, + .data_threshold = DEFAULT_DATA_THRESHOLD, + }; if (path) { char *t;