84b277
From 85658c05781da6137bf8c93d1454aa588ab98696 Mon Sep 17 00:00:00 2001
84b277
From: Lennart Poettering <lennart@poettering.net>
84b277
Date: Tue, 18 Feb 2014 21:23:16 +0100
84b277
Subject: [PATCH] load-modules: properly return a failing error code if some
84b277
 module fails to load
84b277
84b277
This is the missing part of b857193b1def5172e3641ca1d5bc9e08ae81aac4.
84b277
84b277
(cherry-picked from 4b462d1a28461b302586b117736ef288fba1012f)
84b277
84b277
Resolves: #1147524
84b277
---
84b277
 src/modules-load/modules-load.c | 8 +++++---
84b277
 1 file changed, 5 insertions(+), 3 deletions(-)
84b277
84b277
diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
84b277
index cba7c55..5d2ca4d 100644
84b277
--- a/src/modules-load/modules-load.c
84b277
+++ b/src/modules-load/modules-load.c
84b277
@@ -306,9 +306,11 @@ int main(int argc, char *argv[]) {
84b277
                                 r = k;
84b277
                 }
84b277
 
84b277
-                r = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);
84b277
-                if (r < 0) {
84b277
-                        log_error("Failed to enumerate modules-load.d files: %s", strerror(-r));
84b277
+                k = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);
84b277
+                if (k < 0) {
84b277
+                        log_error("Failed to enumerate modules-load.d files: %s", strerror(-k));
84b277
+                        if (r == 0)
84b277
+                                r = k;
84b277
                         goto finish;
84b277
                 }
84b277