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
+11 -11
View File
@@ -388,7 +388,7 @@ int cg_kill_recursive(
while ((r = cg_read_subgroup(d, &fn)) > 0) {
_cleanup_free_ char *p = NULL;
p = strjoin(path, "/", fn);
p = path_join(path, fn);
free(fn);
if (!p)
return -ENOMEM;
@@ -522,7 +522,7 @@ int cg_migrate_recursive(
while ((r = cg_read_subgroup(d, &fn)) > 0) {
_cleanup_free_ char *p = NULL;
p = strjoin(pfrom, "/", fn);
p = path_join(pfrom, fn);
free(fn);
if (!p)
return -ENOMEM;
@@ -610,13 +610,13 @@ static int join_path_legacy(const char *controller, const char *path, const char
dn = controller_to_dirname(controller);
if (isempty(path) && isempty(suffix))
t = strappend("/sys/fs/cgroup/", dn);
t = path_join("/sys/fs/cgroup", dn);
else if (isempty(path))
t = strjoin("/sys/fs/cgroup/", dn, "/", suffix);
t = path_join("/sys/fs/cgroup", dn, suffix);
else if (isempty(suffix))
t = strjoin("/sys/fs/cgroup/", dn, "/", path);
t = path_join("/sys/fs/cgroup", dn, path);
else
t = strjoin("/sys/fs/cgroup/", dn, "/", path, "/", suffix);
t = path_join("/sys/fs/cgroup", dn, path, suffix);
if (!t)
return -ENOMEM;
@@ -632,11 +632,11 @@ static int join_path_unified(const char *path, const char *suffix, char **fs) {
if (isempty(path) && isempty(suffix))
t = strdup("/sys/fs/cgroup");
else if (isempty(path))
t = strappend("/sys/fs/cgroup/", suffix);
t = path_join("/sys/fs/cgroup", suffix);
else if (isempty(suffix))
t = strappend("/sys/fs/cgroup/", path);
t = path_join("/sys/fs/cgroup", path);
else
t = strjoin("/sys/fs/cgroup/", path, "/", suffix);
t = path_join("/sys/fs/cgroup", path, suffix);
if (!t)
return -ENOMEM;
@@ -663,7 +663,7 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch
else if (!path)
t = strdup(suffix);
else
t = strjoin(path, "/", suffix);
t = path_join(path, suffix);
if (!t)
return -ENOMEM;
@@ -1267,7 +1267,7 @@ int cg_is_empty_recursive(const char *controller, const char *path) {
while ((r = cg_read_subgroup(d, &fn)) > 0) {
_cleanup_free_ char *p = NULL;
p = strjoin(path, "/", fn);
p = path_join(path, fn);
free(fn);
if (!p)
return -ENOMEM;