From: Susant Sahani Date: Mon, 18 Jan 2021 11:16:34 +0000 (+0100) Subject: journal: context - use hashmap_ensure_put X-Git-Tag: v248-rc1~306^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=becee4da44bdc17b0c56f54e5559b078c0eddb88;p=thirdparty%2Fsystemd.git journal: context - use hashmap_ensure_put --- diff --git a/src/journal/journald-context.c b/src/journal/journald-context.c index 577d5254c5c..f67013e80ce 100644 --- a/src/journal/journald-context.c +++ b/src/journal/journald-context.c @@ -109,10 +109,6 @@ static int client_context_new(Server *s, pid_t pid, ClientContext **ret) { assert(pid_is_valid(pid)); assert(ret); - r = hashmap_ensure_allocated(&s->client_contexts, NULL); - if (r < 0) - return r; - r = prioq_ensure_allocated(&s->client_contexts_lru, client_context_compare); if (r < 0) return r; @@ -136,7 +132,7 @@ static int client_context_new(Server *s, pid_t pid, ClientContext **ret) { .log_ratelimit_burst = s->ratelimit_burst, }; - r = hashmap_put(s->client_contexts, PID_TO_PTR(pid), c); + r = hashmap_ensure_put(&s->client_contexts, NULL, PID_TO_PTR(pid), c); if (r < 0) return r;