tree-wide: make use of path_extend() at many places

This is not a comprehensive port, but mostly some low-hanging fruit.
This commit is contained in:
Lennart Poettering
2021-05-27 17:05:38 +02:00
parent 7ae2768028
commit 4ede980249
6 changed files with 44 additions and 65 deletions
+4 -10
View File
@@ -123,13 +123,10 @@ int tempfn_xxxxxx(const char *p, const char *extra, char **ret) {
return -EINVAL;
if (d) {
char *j;
j = path_join(d, nf);
if (!j)
if (!path_extend(&d, nf))
return -ENOMEM;
*ret = path_simplify(j, false);
*ret = path_simplify(TAKE_PTR(d), false);
} else
*ret = TAKE_PTR(nf);
@@ -168,13 +165,10 @@ int tempfn_random(const char *p, const char *extra, char **ret) {
return -EINVAL;
if (d) {
char *j;
j = path_join(d, nf);
if (!j)
if (!path_extend(&d, nf))
return -ENOMEM;
*ret = path_simplify(j, false);
*ret = path_simplify(TAKE_PTR(d), false);
} else
*ret = TAKE_PTR(nf);