load-dropin: rename variable
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Feb 2018 11:20:14 +0000 (12:20 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 13 Apr 2018 09:34:48 +0000 (11:34 +0200)
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

index 9fde348..854c2fd 100644 (file)
 #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) {