From: Susant Sahani Date: Mon, 18 Jan 2021 17:24:56 +0000 (+0100) Subject: share: bus-unit-procs - use hashmap_ensure_put X-Git-Tag: v248-rc1~306^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5088e5e79f88659eff2f99993b3e528d6d30835c;p=thirdparty%2Fsystemd.git share: bus-unit-procs - use hashmap_ensure_put --- diff --git a/src/shared/bus-unit-procs.c b/src/shared/bus-unit-procs.c index 3e97be96715..b76125e551f 100644 --- a/src/shared/bus-unit-procs.c +++ b/src/shared/bus-unit-procs.c @@ -104,11 +104,7 @@ static int add_process( if (r < 0) return r; - r = hashmap_ensure_allocated(&cg->pids, &trivial_hash_ops); - if (r < 0) - return r; - - return hashmap_put(cg->pids, PID_TO_PTR(pid), (void*) name); + return hashmap_ensure_put(&cg->pids, &trivial_hash_ops, PID_TO_PTR(pid), (void*) name); } static void remove_cgroup(Hashmap *cgroups, struct CGroupInfo *cg) {