From 77cc47d8b403341e9ecad7a67bb1c675cc8cec56 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 23 Feb 2018 12:20:14 +0100 Subject: [PATCH] load-dropin: rename variable We are converting the unit name into its template, hence name the variable that way, instead of the misleading 'prefix'. --- src/core/load-dropin.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/core/load-dropin.c b/src/core/load-dropin.c index 9fde34893d..854c2fd853 100644 --- a/src/core/load-dropin.c +++ b/src/core/load-dropin.c @@ -18,26 +18,21 @@ #include "unit.h" static int unit_name_compatible(const char *a, const char *b) { - _cleanup_free_ char *prefix = NULL; + _cleanup_free_ char *template = NULL; int r; - /* the straightforward case: the symlink name matches the target */ + /* The straightforward case: the symlink name matches the target */ if (streq(a, b)) return 1; - r = unit_name_template(a, &prefix); + r = unit_name_template(a, &template); if (r == -EINVAL) - /* not a template */ - return 0; + return 0; /* Not a template */ if (r < 0) - /* oom, or some other failure. Just skip the warning. */ - return r; + return r; /* OOM, or some other failure. Just skip the warning. */ - /* an instance name points to a target that is just the template name */ - if (streq(prefix, b)) - return 1; - - return 0; + /* An instance name points to a target that is just the template name */ + return streq(template, b); } static int process_deps(Unit *u, UnitDependency dependency, const char *dir_suffix) { -- 2.25.1