chiark / gitweb /
util: introduce join() to speed up simple string concatenations
[elogind.git] / src / load-dropin.c
index d30865cbc53789a5442d9fa76e2efab49c1ce893..984a47a297da5cfe521fb36a6e9fd03028886623 100644 (file)
@@ -78,7 +78,8 @@ static int process_dir(Unit *u, const char *unit_path, const char *name, const c
         assert(name);
         assert(suffix);
 
-        if (asprintf(&path, "%s/%s%s", unit_path, name, suffix) < 0)
+        path = join(unit_path, "/", name, suffix, NULL);
+        if (!path)
                 return -ENOMEM;
 
         if (u->meta.manager->unit_path_cache &&