chiark / gitweb /
update TODO
[elogind.git] / src / load-dropin.c
index 984a47a297da5cfe521fb36a6e9fd03028886623..eafcc2fdf36ec83c1a2c25dd85057f3dbb926fb5 100644 (file)
@@ -50,7 +50,8 @@ static int iterate_dir(Unit *u, const char *path, UnitDependency dependency) {
                 if (ignore_file(de->d_name))
                         continue;
 
-                if (asprintf(&f, "%s/%s", path, de->d_name) < 0) {
+                f = join(path, "/", de->d_name, NULL);
+                if (!f) {
                         r = -ENOMEM;
                         goto finish;
                 }
@@ -99,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;
 
-                r = asprintf(&path, "%s/%s%s", unit_path, template, suffix);
+                path = join(unit_path, "/", template, suffix, NULL);
                 free(template);
 
-                if (r < 0)
+                if (!path)
                         return -ENOMEM;
 
                 if (u->meta.manager->unit_path_cache &&