chiark / gitweb /
util: more join() optimizations
[elogind.git] / src / load-dropin.c
index dbdc6a41df9a35ab09d133721cf60c23296e0d56..eafcc2fdf36ec83c1a2c25dd85057f3dbb926fb5 100644 (file)
@@ -100,10 +100,10 @@ static int process_dir(Unit *u, const char *unit_path, const char *name, const c
                 if (!(template = unit_name_template(name)))
                         return -ENOMEM;
 
                 if (!(template = unit_name_template(name)))
                         return -ENOMEM;
 
-                r = asprintf(&path, "%s/%s%s", unit_path, template, suffix);
+                path = join(unit_path, "/", template, suffix, NULL);
                 free(template);
 
                 free(template);
 
-                if (r < 0)
+                if (!path)
                         return -ENOMEM;
 
                 if (u->meta.manager->unit_path_cache &&
                         return -ENOMEM;
 
                 if (u->meta.manager->unit_path_cache &&