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;
}
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 &&
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 &&