diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 14d3725709..3ed8e2c8a9 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -980,9 +980,9 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags, /* Prefix what's left to do with what we just read, and start the loop again, but * remain in the current directory. */ - joined = strjoin(destination, todo); + joined = path_join(destination, todo); } else - joined = strjoin("/", destination, todo); + joined = path_join("/", destination, todo); if (!joined) return -ENOMEM; diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index b3f4be0e6e..7ada411636 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -1949,7 +1949,7 @@ static int copy_devnodes(const char *dest) { if (!prefixed) return log_oom(); - t = strjoin("../", d); + t = path_join("..", d); if (!t) return log_oom(); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 334e3fb5f4..7b091006ea 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -2471,7 +2471,7 @@ static int patch_var_run(const char *fname, unsigned line, char **path) { if (isempty(k)) /* Don't complain about other paths than /var/run, and not about /var/run itself either. */ return 0; - n = strjoin("/run/", k); + n = path_join("/run", k); if (!n) return log_oom(); diff --git a/src/veritysetup/veritysetup-generator.c b/src/veritysetup/veritysetup-generator.c index 65a4e7b0fd..f2b74f3dc1 100644 --- a/src/veritysetup/veritysetup-generator.c +++ b/src/veritysetup/veritysetup-generator.c @@ -16,6 +16,7 @@ #include "main-func.h" #include "mkdir.h" #include "parse-util.h" +#include "path-util.h" #include "proc-cmdline.h" #include "specifier.h" #include "string-util.h" @@ -188,7 +189,7 @@ static int determine_devices(void) { if (!arg_data_what) { memcpy(&root_uuid, m, sizeof(root_uuid)); - arg_data_what = strjoin("/dev/disk/by-partuuid/", id128_to_uuid_string(root_uuid, ids)); + arg_data_what = path_join("/dev/disk/by-partuuid", id128_to_uuid_string(root_uuid, ids)); if (!arg_data_what) return log_oom(); } @@ -196,7 +197,7 @@ static int determine_devices(void) { if (!arg_hash_what) { memcpy(&verity_uuid, (uint8_t*) m + l - sizeof(verity_uuid), sizeof(verity_uuid)); - arg_hash_what = strjoin("/dev/disk/by-partuuid/", id128_to_uuid_string(verity_uuid, ids)); + arg_hash_what = path_join("/dev/disk/by-partuuid", id128_to_uuid_string(verity_uuid, ids)); if (!arg_hash_what) return log_oom(); }