summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-05-30 21:18:08 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-05-30 21:18:08 +0200
commit9f91d2fbdeb35cfe3a3afdd2fa5571bcb5b6c51d (patch)
treea8dc3caa2576dfbc79cffc80a4808093fcf0dd95
parentbpf: test with GCC BPF compiler on opensuse (diff)
downloadsystemd-9f91d2fbdeb35cfe3a3afdd2fa5571bcb5b6c51d.tar.xz
systemd-9f91d2fbdeb35cfe3a3afdd2fa5571bcb5b6c51d.zip
journal-remote: use structured initialization
-rw-r--r--src/journal-remote/journal-remote-write.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/journal-remote/journal-remote-write.c b/src/journal-remote/journal-remote-write.c
index 2d8188ec62..515ea2681e 100644
--- a/src/journal-remote/journal-remote-write.c
+++ b/src/journal-remote/journal-remote-write.c
@@ -28,19 +28,20 @@ int writer_new(RemoteServer *server, Writer **ret) {
assert(server);
assert(ret);
- w = new0(Writer, 1);
+ w = new(Writer, 1);
if (!w)
return -ENOMEM;
- w->n_ref = 1;
- w->metrics = server->metrics;
+ *w = (Writer) {
+ .n_ref = 1,
+ .metrics = server->metrics,
+ .server = server,
+ };
w->mmap = mmap_cache_new();
if (!w->mmap)
return -ENOMEM;
- w->server = server;
-
if (is_dir(server->output, /* follow = */ true) > 0) {
w->output = strdup(server->output);
if (!w->output)