summaryrefslogtreecommitdiff
path: root/src/journal/journald-context.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-11-22 15:28:53 +0100
committerLennart Poettering <lennart@poettering.net>2020-01-31 15:00:53 +0100
commit74dd8f57593236888fab504aae0376e02726e278 (patch)
tree263c2c658045c94a24c0dc8c7584de0730b0f9a2 /src/journal/journald-context.c
parent8548f4f09ba6b257a919d111437079720dd1c70c (diff)
downloadsystemd-74dd8f57593236888fab504aae0376e02726e278.tar.gz
journald: use structured initialization
Diffstat (limited to 'src/journal/journald-context.c')
-rw-r--r--src/journal/journald-context.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/journal/journald-context.c b/src/journal/journald-context.c
index cd4cfbee48..c2d8972355 100644
--- a/src/journal/journald-context.c
+++ b/src/journal/journald-context.c
@@ -117,23 +117,24 @@ static int client_context_new(Server *s, pid_t pid, ClientContext **ret) {
if (r < 0)
return r;
- c = new0(ClientContext, 1);
+ c = new(ClientContext, 1);
if (!c)
return -ENOMEM;
- c->pid = pid;
-
- c->uid = UID_INVALID;
- c->gid = GID_INVALID;
- c->auditid = AUDIT_SESSION_INVALID;
- c->loginuid = UID_INVALID;
- c->owner_uid = UID_INVALID;
- c->lru_index = PRIOQ_IDX_NULL;
- c->timestamp = USEC_INFINITY;
- c->extra_fields_mtime = NSEC_INFINITY;
- c->log_level_max = -1;
- c->log_ratelimit_interval = s->ratelimit_interval;
- c->log_ratelimit_burst = s->ratelimit_burst;
+ *c = (ClientContext) {
+ .pid = pid,
+ .uid = UID_INVALID,
+ .gid = GID_INVALID,
+ .auditid = AUDIT_SESSION_INVALID,
+ .loginuid = UID_INVALID,
+ .owner_uid = UID_INVALID,
+ .lru_index = PRIOQ_IDX_NULL,
+ .timestamp = USEC_INFINITY,
+ .extra_fields_mtime = NSEC_INFINITY,
+ .log_level_max = -1,
+ .log_ratelimit_interval = s->ratelimit_interval,
+ .log_ratelimit_burst = s->ratelimit_burst,
+ };
r = hashmap_put(s->client_contexts, PID_TO_PTR(pid), c);
if (r < 0) {