]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: use compound initializors at one more place
authorLennart Poettering <lennart@poettering.net>
Mon, 16 Jan 2023 13:06:23 +0000 (14:06 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 20 Jan 2023 20:46:50 +0000 (21:46 +0100)
src/libsystemd/sd-journal/sd-journal.c

index ac8ca0f54b47a56e58de0d689b57d99c004cd725..035d7ccef8214c0a96aa7f494c49e25bbfe5271e 100644 (file)
@@ -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;