]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: replace strjoin() with path_join()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 Jun 2019 14:59:38 +0000 (23:59 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 Jun 2019 14:59:38 +0000 (23:59 +0900)
src/basic/fs-util.c
src/nspawn/nspawn.c
src/tmpfiles/tmpfiles.c
src/veritysetup/veritysetup-generator.c

index 14d372570998ee923b8db832415013f77b95936c..3ed8e2c8a9371bf62865fbac4cebb0cc5493433b 100644 (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;
 
index b3f4be0e6e3dd31eb5c20e778d14db9e86e3271f..7ada4116368b5c9c904f66c41049a9f8544d9dba 100644 (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();
 
index 334e3fb5f463267f3cb69647416cc7292e107633..7b091006ea741b0240951366995c0be07226e56f 100644 (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();
 
index 65a4e7b0fd558d5d200fb5998d89631ee23c79ec..f2b74f3dc14a55541864091feaf0bb37cb9c86d8 100644 (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();
         }