chiark / gitweb /
load-modules: properly return a failing error code if some module fails to load
authorLennart Poettering <lennart@poettering.net>
Tue, 18 Feb 2014 20:23:16 +0000 (21:23 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Feb 2014 20:23:16 +0000 (21:23 +0100)
This is the missing part of b857193b1def5172e3641ca1d5bc9e08ae81aac4.

src/modules-load/modules-load.c

index 1a32d26..c3aa409 100644 (file)
@@ -286,9 +286,11 @@ int main(int argc, char *argv[]) {
                                 r = k;
                 }
 
-                r = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);
-                if (r < 0) {
-                        log_error("Failed to enumerate modules-load.d files: %s", strerror(-r));
+                k = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);
+                if (k < 0) {
+                        log_error("Failed to enumerate modules-load.d files: %s", strerror(-k));
+                        if (r == 0)
+                                r = k;
                         goto finish;
                 }