dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
84b277
From 762f7d479be5217a2109dbf0f97fe82e1155e6ee Mon Sep 17 00:00:00 2001
84b277
From: Lennart Poettering <lennart@poettering.net>
84b277
Date: Thu, 22 May 2014 16:47:46 +0900
84b277
Subject: [PATCH] conf-parser: never consider it an error if we cannot load a
84b277
 drop-in file because it is missing
84b277
84b277
After all, we want to be able to boot with /etc empty one day...
84b277
84b277
(cherry-picked from 9f43a07f10639c5b41b45448e551e43914eefe32)
84b277
84b277
Resolves: #1147524
84b277
---
84b277
 src/shared/conf-parser.c | 4 ++--
84b277
 1 file changed, 2 insertions(+), 2 deletions(-)
84b277
84b277
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
84b277
index 6085d33..db71168 100644
84b277
--- a/src/shared/conf-parser.c
84b277
+++ b/src/shared/conf-parser.c
84b277
@@ -320,8 +320,8 @@ int config_parse(const char *unit,
84b277
         if (!f) {
84b277
                 f = ours = fopen(filename, "re");
84b277
                 if (!f) {
84b277
-                        log_error("Failed to open configuration file '%s': %m", filename);
84b277
-                        return -errno;
84b277
+                        log_full(errno == ENOENT ? LOG_DEBUG : LOG_ERR, "Failed to open configuration file '%s': %m", filename);
84b277
+                        return errno == ENOENT ? 0 : -errno;
84b277
                 }
84b277
         }
84b277