summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-09 20:07:00 +0100
committerLennart Poettering <lennart@poettering.net>2017-02-09 20:08:24 +0100
commit09c624878abc325fc2768f3385988d6ceeaa2d87 (patch)
tree7df6f8fc825b6f552897353272d60db915daeb66
parent9c0f732c62b18304973f1ede23d4a48191f5db43 (diff)
dropin: downgrade logging about paths we cannot canonicalize
After all, most units won't have drop-in dirs, hence there's no point in logging about that. Fixes: #5252
-rw-r--r--src/shared/dropin.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/dropin.c b/src/shared/dropin.c
index 3917eb8f23..3ed98f5e0b 100644
--- a/src/shared/dropin.c
+++ b/src/shared/dropin.c
@@ -43,11 +43,10 @@
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)