]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dropin: downgrade logging about paths we cannot canonicalize
authorLennart Poettering <lennart@poettering.net>
Thu, 9 Feb 2017 19:07:00 +0000 (20:07 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 9 Feb 2017 19:08:24 +0000 (20:08 +0100)
After all, most units won't have drop-in dirs, hence there's no point in
logging about that.

Fixes: #5252
src/shared/dropin.c

index 3917eb8f236c6b9194c86ea604310c8e8da305e0..3ed98f5e0b717ff5791d68163a4e230858abf111 100644 (file)
 int drop_in_file(const char *dir, const char *unit, unsigned level,
                  const char *name, char **_p, char **_q) {
 
+        char prefix[DECIMAL_STR_MAX(unsigned)];
         _cleanup_free_ char *b = NULL;
         char *p, *q;
 
-        char prefix[DECIMAL_STR_MAX(unsigned)];
-
         assert(unit);
         assert(name);
         assert(_p);
@@ -128,9 +127,10 @@ static int unit_file_find_dir(
         assert(path);
 
         r = chase_symlinks(path, original_root, 0, &chased);
+        if (r == -ENOENT) /* Ignore -ENOENT, after all most units won't have a drop-in dir */
+                return 0;
         if (r < 0)
-                return log_full_errno(r == -ENOENT ? LOG_DEBUG : LOG_WARNING,
-                                      r, "Failed to canonicalize path %s: %m", path);
+                return log_full_errno(LOG_WARNING, r, "Failed to canonicalize path %s: %m", path);
 
         r = strv_push(dirs, chased);
         if (r < 0)