Blob Blame History Raw
From 89713133365b14634ed3f7e2812d4ddc17be0390 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 29 May 2024 11:45:50 +0200
Subject: [PATCH 1/3] generator-setup: use RET_GATHER()

---
 src/core/generator-setup.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/core/generator-setup.c b/src/core/generator-setup.c
index 00d6ad61fa..b16211e8f4 100644
--- a/src/core/generator-setup.c
+++ b/src/core/generator-setup.c
@@ -8,7 +8,7 @@
 #include "rm-rf.h"
 
 int lookup_paths_mkdir_generator(LookupPaths *p) {
-        int r, q;
+        int r;
 
         assert(p);
 
@@ -16,14 +16,8 @@ int lookup_paths_mkdir_generator(LookupPaths *p) {
                 return -EINVAL;
 
         r = mkdir_p_label(p->generator, 0755);
-
-        q = mkdir_p_label(p->generator_early, 0755);
-        if (q < 0 && r >= 0)
-                r = q;
-
-        q = mkdir_p_label(p->generator_late, 0755);
-        if (q < 0 && r >= 0)
-                r = q;
+        RET_GATHER(r, mkdir_p_label(p->generator_early, 0755));
+        RET_GATHER(r, mkdir_p_label(p->generator_late, 0755));
 
         return r;
 }
-- 
2.45.0