diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-30 10:40:38 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-30 10:40:38 +0100 |
commit | 30016f21b36599a0c5c563f165db48ddb32d6521 (patch) | |
tree | 094a167b640b03c791f9764ca9c6a7d329aa8772 /src/basic | |
parent | b2ac2b01c8ddaabbe63bcb7168dd752f44320d86 (diff) | |
download | systemd-30016f21b36599a0c5c563f165db48ddb32d6521.tar.gz |
tree-wide: replace path_join with path_join_many
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/conf-files.c | 6 | ||||
-rw-r--r-- | src/basic/path-util.c | 2 | ||||
-rw-r--r-- | src/basic/path-util.h | 5 | ||||
-rw-r--r-- | src/basic/selinux-util.c | 6 |
4 files changed, 6 insertions, 13 deletions
diff --git a/src/basic/conf-files.c b/src/basic/conf-files.c index 7b44ae277d..4211600611 100644 --- a/src/basic/conf-files.c +++ b/src/basic/conf-files.c @@ -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(); } diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 7d1e0f3f2d..cb9987da4b 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -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; diff --git a/src/basic/path-util.h b/src/basic/path-util.h index 8bda450ff3..e1e50bc2bd 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -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); diff --git a/src/basic/selinux-util.c b/src/basic/selinux-util.c index d5228f6746..213b6c421e 100644 --- a/src/basic/selinux-util.c +++ b/src/basic/selinux-util.c @@ -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); |