summaryrefslogtreecommitdiffstats
path: root/src/tmpfiles
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-06-05 15:12:29 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-06-22 16:32:37 +0200
commitde7fef4b6eb4f5ca1cd21a309c37d0a74d4d305b (patch)
treeead57ab4a03ef723497b65d0efd79ea8973aaaed /src/tmpfiles
parentbasic/set: add set_ensure_put() (diff)
downloadsystemd-de7fef4b6eb4f5ca1cd21a309c37d0a74d4d305b.tar.xz
systemd-de7fef4b6eb4f5ca1cd21a309c37d0a74d4d305b.zip
tree-wide: use set_ensure_put()
Patch contains a coccinelle script, but it only works in some cases. Many parts were converted by hand. Note: I did not fix errors in return value handing. This will be done separate to keep the patch comprehensible. No functional change is intended in this patch.
Diffstat (limited to 'src/tmpfiles')
-rw-r--r--src/tmpfiles/tmpfiles.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index e827de1b06..7938cb3d73 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -3196,11 +3196,7 @@ static int link_parent(ItemArray *a) {
if (!j)
j = ordered_hashmap_get(globs, prefix);
if (j) {
- r = set_ensure_allocated(&j->children, NULL);
- if (r < 0)
- return log_oom();
-
- r = set_put(j->children, a);
+ r = set_ensure_put(&j->children, NULL, a);
if (r < 0)
return log_oom();