tree-wide: replace path_join with path_join_many
This commit is contained in:
@@ -216,7 +216,7 @@ int conf_files_insert(char ***strv, const char *root, char **dirs, const char *p
|
||||
p2 = path_startswith(path, *dir);
|
||||
if (p2) {
|
||||
/* Our new entry has higher priority */
|
||||
t = path_join(root, path, NULL);
|
||||
t = path_join_many(strempty(root), path);
|
||||
if (!t)
|
||||
return log_oom();
|
||||
|
||||
@@ -232,7 +232,7 @@ int conf_files_insert(char ***strv, const char *root, char **dirs, const char *p
|
||||
/* … we are not there yet, let's continue */
|
||||
}
|
||||
|
||||
t = path_join(root, path, NULL);
|
||||
t = path_join_many(strempty(root), path);
|
||||
if (!t)
|
||||
return log_oom();
|
||||
|
||||
@@ -318,7 +318,7 @@ int conf_files_list_with_replacement(
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to extend config file list: %m");
|
||||
|
||||
p = path_join(root, replacement, NULL);
|
||||
p = path_join_many(strempty(root), replacement);
|
||||
if (!p)
|
||||
return log_oom();
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ int path_make_absolute_cwd(const char *p, char **ret) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
c = path_join(NULL, cwd, p);
|
||||
c = path_join_many(cwd, p);
|
||||
}
|
||||
if (!c)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -51,11 +51,6 @@ bool path_equal(const char *a, const char *b) _pure_;
|
||||
bool path_equal_or_files_same(const char *a, const char *b, int flags);
|
||||
char* path_join_many_internal(const char *first, ...) _sentinel_;
|
||||
#define path_join_many(x, ...) path_join_many_internal(x, __VA_ARGS__, NULL)
|
||||
static inline char* path_join(const char *root, const char *path, const char *rest) {
|
||||
assert(path);
|
||||
|
||||
return path_join_many(strempty(root), path, rest);
|
||||
}
|
||||
|
||||
char* path_simplify(char *path, bool kill_dots);
|
||||
|
||||
|
||||
@@ -366,11 +366,9 @@ int mac_selinux_create_file_prepare_at(int dirfd, const char *path, mode_t mode)
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
abspath = path_join(NULL, p, path);
|
||||
if (!abspath)
|
||||
path = abspath = path_join_many(p, path);
|
||||
if (!path)
|
||||
return -ENOMEM;
|
||||
|
||||
path = abspath;
|
||||
}
|
||||
|
||||
r = selinux_create_file_prepare_abspath(path, mode);
|
||||
|
||||
Reference in New Issue
Block a user