Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates-src > by-pkgid > ab4b662b9827b6375ffd451bf4abd615 > files > 495

systemd-44-24.fc17.src.rpm

From 0585e7484223c4fe85113d0f3e41cde3469b6a6e Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Tue, 24 Jul 2012 23:18:25 +0200
Subject: [PATCH] conf-files: continue searching if one dir fails

A problem with systemd-tmpfiles has been observed where the service
failed just because one of the configuration directories could not be
read due to SELinux policy.

Complain about the failure, but try to go on.

https://bugzilla.redhat.com/show_bug.cgi?id=839736
(cherry picked from commit 578ac0604e6c10b267f73e114bc2215aa3f6619a)
---
 src/shared/conf-files.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
index 487c9a5..83e4cce 100644
--- a/src/shared/conf-files.c
+++ b/src/shared/conf-files.c
@@ -93,7 +93,7 @@ int conf_files_list_strv(char ***strv, const char *suffix, const char **dirs) {
         Hashmap *fh = NULL;
         char **files = NULL;
         const char **p;
-        int r = 0;
+        int r;
 
         assert(dirs);
 
@@ -104,11 +104,10 @@ int conf_files_list_strv(char ***strv, const char *suffix, const char **dirs) {
         }
 
         STRV_FOREACH(p, dirs) {
-                if (files_add(fh, *p, suffix) < 0) {
-                        log_error("Failed to search for files.");
-                        r = -EINVAL;
-                        goto finish;
-                }
+                r = files_add(fh, *p, suffix);
+                if (r < 0)
+                        log_warning("Failed to search for files in %s: %s",
+                                    *p, strerror(-r));
         }
 
         files = hashmap_get_strv(fh);
@@ -118,6 +117,7 @@ int conf_files_list_strv(char ***strv, const char *suffix, const char **dirs) {
                 goto finish;
         }
         qsort(files, hashmap_size(fh), sizeof(char *), base_cmp);
+        r = 0;
 
 finish:
         hashmap_free(fh);