chiark / gitweb /
update TODO
[elogind.git] / src / load-dropin.c
index d30865cbc53789a5442d9fa76e2efab49c1ce893..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;
                 }
@@ -78,7 +79,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 &&
@@ -98,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 &&