From: Lennart Poettering Date: Thu, 9 Feb 2017 19:07:00 +0000 (+0100) Subject: dropin: downgrade logging about paths we cannot canonicalize X-Git-Tag: v234~529^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09c624878abc325fc2768f3385988d6ceeaa2d87;p=platform%2Fupstream%2Fsystemd.git 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 --- diff --git a/src/shared/dropin.c b/src/shared/dropin.c index 3917eb8..3ed98f5 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)