tree-wide: replace strjoin() with path_join()

This commit is contained in:
Yu Watanabe 2019-06-24 23:59:38 +09:00
parent f9421dd847
commit 2d9b74ba87
4 changed files with 7 additions and 6 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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();

View File

@ -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();
}