Merge pull request #12836 from yuwata/tree-wide-replace-strjoin

tree-wide: replace strjoin() with path_join()
This commit is contained in:
Lennart Poettering
2019-06-22 20:02:46 +02:00
committed by GitHub
44 changed files with 95 additions and 126 deletions
+2 -1
View File
@@ -31,6 +31,7 @@
#include "mountpoint-util.h"
#include "nsflags.h"
#include "parse-util.h"
#include "path-util.h"
#include "proc-cmdline.h"
#include "rlimit-util.h"
#include "stdio-util.h"
@@ -1552,7 +1553,7 @@ int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id,
if (!external_label)
return -ENOMEM;
p = strjoin(prefix, "/", sender_label, "/", external_label);
p = path_join(prefix, sender_label, external_label);
if (!p)
return -ENOMEM;
+1 -1
View File
@@ -148,7 +148,7 @@ int show_cgroup_by_path(
while ((r = cg_read_subgroup(d, &gn)) > 0) {
_cleanup_free_ char *k = NULL;
k = strjoin(fn, "/", gn);
k = path_join(fn, gn);
free(gn);
if (!k)
return -ENOMEM;
+1 -1
View File
@@ -994,7 +994,7 @@ static int make_dm_name_and_node(const void *original_node, const char *suffix,
if (!filename_is_valid(name))
return -EINVAL;
node = strjoin(crypt_get_dir(), "/", name);
node = path_join(crypt_get_dir(), name);
if (!node)
return -ENOMEM;
+4 -4
View File
@@ -1424,7 +1424,7 @@ static int unit_file_search(
STRV_FOREACH(p, paths->search_path) {
_cleanup_free_ char *path = NULL;
path = strjoin(*p, "/", info->name);
path = path_join(*p, info->name);
if (!path)
return -ENOMEM;
@@ -1447,7 +1447,7 @@ static int unit_file_search(
STRV_FOREACH(p, paths->search_path) {
_cleanup_free_ char *path = NULL;
path = strjoin(*p, "/", template);
path = path_join(*p, template);
if (!path)
return -ENOMEM;
@@ -1840,7 +1840,7 @@ static int install_info_symlink_link(
if (r > 0)
return 0;
path = strjoin(config_path, "/", i->name);
path = path_join(config_path, i->name);
if (!path)
return -ENOMEM;
@@ -2379,7 +2379,7 @@ int unit_file_revert(
STRV_FOREACH(j, fs) {
_cleanup_free_ char *t = NULL;
t = strjoin(*i, "/", *j);
t = path_join(*i, *j);
if (!t)
return -ENOMEM;
+1 -4
View File
@@ -146,10 +146,7 @@ static int image_new(
if (!i->name)
return -ENOMEM;
if (path)
i->path = strjoin(path, "/", filename);
else
i->path = strdup(filename);
i->path = path_join(path, filename);
if (!i->path)
return -ENOMEM;
+1 -1
View File
@@ -303,7 +303,7 @@ static int acquire_transient_dir(
return -EOPNOTSUPP;
if (tempdir)
transient = strjoin(tempdir, "/transient");
transient = path_join(tempdir, "transient");
else if (scope == UNIT_FILE_SYSTEM)
transient = strdup("/run/systemd/transient");
else