From de7fef4b6eb4f5ca1cd21a309c37d0a74d4d305b Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 5 Jun 2020 15:12:29 +0200 Subject: 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. --- src/sysv-generator/sysv-generator.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/sysv-generator') diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c index eb6b2d084e..84f329e37d 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c @@ -885,13 +885,7 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic service->sysv_start_priority = MAX(a*10 + b, service->sysv_start_priority); - r = set_ensure_allocated(&runlevel_services[i], NULL); - if (r < 0) { - log_oom(); - goto finish; - } - - r = set_put(runlevel_services[i], service); + r = set_ensure_put(&runlevel_services[i], NULL, service); if (r < 0) { log_oom(); goto finish; -- cgit v1.2.3