]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
generator-setup: use RET_GATHER()
authorLennart Poettering <lennart@poettering.net>
Wed, 29 May 2024 09:45:50 +0000 (11:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 29 May 2024 09:52:40 +0000 (11:52 +0200)
src/core/generator-setup.c

index 00d6ad61fa0d9b2dea4c648a453a82f082225c5c..b16211e8f46ae79478d931a7b1134a8829fbecb5 100644 (file)
@@ -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;
 }