]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: rename path_join_many() to path_join()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 30 Nov 2018 09:43:57 +0000 (10:43 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 30 Nov 2018 09:59:47 +0000 (10:59 +0100)
$ git grep -e path_join_many -l|xargs sed -r -i 's/path_join_many/path_join/g'

The two test functions are merged into one.

23 files changed:
src/analyze/analyze-verify.c
src/basic/conf-files.c
src/basic/path-util.c
src/basic/path-util.h
src/basic/selinux-util.c
src/journal/journalctl.c
src/libsystemd/sd-hwdb/hwdb-util.c
src/resolve/test-dns-packet.c
src/shared/install.c
src/shared/pretty-print.c
src/shared/tests.c
src/systemctl/systemctl.c
src/test/test-execute.c
src/test/test-journal-importer.c
src/test/test-mountpoint-util.c
src/test/test-path-util.c
src/test/test-path.c
src/test/test-umount.c
src/tmpfiles/tmpfiles.c
src/udev/udev-event.c
src/udev/udev-node.c
src/udev/udevadm-trigger.c
src/udev/udevadm-util.c

index 1abba6d3da1a4e46b151ac63790b40ef44d6b65a..1d8a1ed7b3249f3d2624241df02df43806cf7802 100644 (file)
@@ -43,7 +43,7 @@ static int prepare_filename(const char *filename, char **ret) {
         if (!dir)
                 return -ENOMEM;
 
-        c = path_join_many(dir, with_instance ?: name);
+        c = path_join(dir, with_instance ?: name);
         if (!c)
                 return -ENOMEM;
 
index 4211600611062229990de531f9fbba887ea550d8..6a2a2055c7138faa9f32bdd01b9e73b0e6a97aef 100644 (file)
@@ -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_many(strempty(root), path);
+                                        t = path_join(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_many(strempty(root), path);
+        t = path_join(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_many(strempty(root), replacement);
+                p = path_join(strempty(root), replacement);
                 if (!p)
                         return log_oom();
         }
index cb9987da4bf00df5d897c2f803a9326ac342bcc1..4d2c9b5f383c4d200b3387a7cd0e83a3c506f70c 100644 (file)
@@ -110,7 +110,7 @@ int path_make_absolute_cwd(const char *p, char **ret) {
                 if (r < 0)
                         return r;
 
-                c = path_join_many(cwd, p);
+                c = path_join(cwd, p);
         }
         if (!c)
                 return -ENOMEM;
@@ -481,7 +481,7 @@ bool path_equal_or_files_same(const char *a, const char *b, int flags) {
         return path_equal(a, b) || files_same(a, b, flags) > 0;
 }
 
-char* path_join_many_internal(const char *first, ...) {
+char* path_join_internal(const char *first, ...) {
         char *joined, *q;
         const char *p;
         va_list ap;
@@ -499,9 +499,9 @@ char* path_join_many_internal(const char *first, ...) {
          *
          * Examples:
          *
-         * path_join_many("foo", "bar") → "foo/bar"
-         * path_join_many("foo/", "bar") → "foo/bar"
-         * path_join_many("", "foo", "", "bar", "") → "foo/bar" */
+         * path_join("foo", "bar") → "foo/bar"
+         * path_join("foo/", "bar") → "foo/bar"
+         * path_join("", "foo", "", "bar", "") → "foo/bar" */
 
         sz = strlen(first);
         va_start(ap, first);
index e1e50bc2bdc9ad29a9d71a215cc4a901cd2169c3..b3786ac86c37cc77bf058cd0f6ab8ef073fe386f 100644 (file)
@@ -49,8 +49,8 @@ char* path_startswith(const char *path, const char *prefix) _pure_;
 int path_compare(const char *a, const char *b) _pure_;
 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)
+char* path_join_internal(const char *first, ...) _sentinel_;
+#define path_join(x, ...) path_join_internal(x, __VA_ARGS__, NULL)
 
 char* path_simplify(char *path, bool kill_dots);
 
index 213b6c421ee6ca4702eb1de412c64132a187d282..dc06f3d0740c59a24e953964fa00bf170efe0cfb 100644 (file)
@@ -366,7 +366,7 @@ int mac_selinux_create_file_prepare_at(int dirfd, const char *path, mode_t mode)
                 if (r < 0)
                         return r;
 
-                path = abspath = path_join_many(p, path);
+                path = abspath = path_join(p, path);
                 if (!path)
                         return -ENOMEM;
         }
index 19d1d3cfc719642619f48730cfbdbb05bb401daa..abf13415e92978e4438611bad2b52c547cd2ce53 100644 (file)
@@ -2110,7 +2110,7 @@ int main(int argc, char *argv[]) {
         case ACTION_UPDATE_CATALOG: {
                 _cleanup_free_ char *database;
 
-                database = path_join_many(strempty(arg_root), CATALOG_DATABASE);
+                database = path_join(strempty(arg_root), CATALOG_DATABASE);
                 if (!database) {
                         r = log_oom();
                         goto finish;
index 5bd594e94e8a332a39c115cc48ee1db7a3a74879..ca989da310ccb3ee7169e8d7a4a18afdfb38f2a2 100644 (file)
@@ -651,7 +651,7 @@ int hwdb_update(const char *root, const char *hwdb_bin_dir, bool strict, bool co
         log_debug("strings dedup'ed: %8zu bytes (%8zu)",
                   trie->strings->dedup_len, trie->strings->dedup_count);
 
-        hwdb_bin = path_join_many(strempty(root), hwdb_bin_dir ?: default_hwdb_bin_dir, "hwdb.bin");
+        hwdb_bin = path_join(strempty(root), hwdb_bin_dir ?: default_hwdb_bin_dir, "hwdb.bin");
         if (!hwdb_bin)
                 return -ENOMEM;
 
index a6b0ae1b819ce90366a7055926eb11ff6618312d..f6df9135ee936410bf82c0cd139fce5c802b2053 100644 (file)
@@ -103,7 +103,7 @@ int main(int argc, char **argv) {
                 N = argc - 1;
                 fnames = argv + 1;
         } else {
-                pkts_glob = path_join_many(get_testdata_dir(), "test-resolve/*.pkts");
+                pkts_glob = path_join(get_testdata_dir(), "test-resolve/*.pkts");
                 assert_se(glob(pkts_glob, GLOB_NOSORT, NULL, &g) == 0);
                 N = g.gl_pathc;
                 fnames = g.gl_pathv;
index 2ba9db3bd4e69ba0b8b0a9f3afcb0f69e35d461f..d172162a3c3121e74defa18a0772df920a439f43 100644 (file)
@@ -1464,7 +1464,7 @@ static int unit_file_search(
         STRV_FOREACH(p, paths->search_path) {
                 char *path;
 
-                path = path_join_many(*p, dropin_dir_name);
+                path = path_join(*p, dropin_dir_name);
                 if (!path)
                         return -ENOMEM;
 
@@ -1478,7 +1478,7 @@ static int unit_file_search(
                 STRV_FOREACH(p, paths->search_path) {
                         char *path;
 
-                        path = path_join_many(*p, dropin_template_dir_name);
+                        path = path_join(*p, dropin_template_dir_name);
                         if (!path)
                                 return -ENOMEM;
 
index ac21c996a8d6a27a868ec24ce23e1078a219ea6e..654afa6b94ef51392c838ed4665d547eba3fe567 100644 (file)
@@ -217,7 +217,7 @@ int conf_files_cat(const char *root, const char *name) {
         if (r < 0)
                 return log_error_errno(r, "Failed to query file list: %m");
 
-        path = path_join_many(strempty(root), "/etc", name);
+        path = path_join(strempty(root), "/etc", name);
         if (!path)
                 return log_oom();
 
index be584dc0fac5958661966f4f52e19f76c919d734..95f22e58b17daa02b03a3b94e4ce1e2c4ed0116b 100644 (file)
@@ -46,7 +46,7 @@ static void load_testdata_env(void) {
         assert_se(readlink_and_make_absolute("/proc/self/exe", &s) >= 0);
         dirname(s);
 
-        envpath = path_join_many(s, "systemd-runtest.env");
+        envpath = path_join(s, "systemd-runtest.env");
         if (load_env_file_pairs(NULL, envpath, &pairs) < 0)
                 return;
 
index 1015c64227af4169dc8c092029d71e101b9b7f1f..efbc3eef96db090df689d9e171b0a458bc2b90db 100644 (file)
@@ -2425,7 +2425,7 @@ static int unit_file_find_path(LookupPaths *lp, const char *unit_name, char **re
                 _cleanup_free_ char *path = NULL, *lpath = NULL;
                 int r;
 
-                path = path_join_many(*p, unit_name);
+                path = path_join(*p, unit_name);
                 if (!path)
                         return log_oom();
 
@@ -3516,9 +3516,9 @@ static int load_kexec_kernel(void) {
                 return -EINVAL;
         }
 
-        kernel = path_join_many(where, e->kernel);
+        kernel = path_join(where, e->kernel);
         if (!strv_isempty(e->initrd))
-                initrd = path_join_many(where, *e->initrd);
+                initrd = path_join(where, *e->initrd);
         options = strv_join(e->options, " ");
         if (!options)
                 return log_oom();
@@ -5975,7 +5975,7 @@ static int enable_sysv_units(const char *verb, char **args) {
                 if (found_native && streq(verb, "is-enabled"))
                         continue;
 
-                p = path_join_many(strempty(arg_root), SYSTEM_SYSVINIT_PATH, name);
+                p = path_join(strempty(arg_root), SYSTEM_SYSVINIT_PATH, name);
                 if (!p)
                         return log_oom();
 
index 85f13cbe97beb7e23f9aab82a37c45ea3c252bf5..fdde079cefc1cf46f2688f5262a60a3d281935f5 100644 (file)
@@ -781,7 +781,7 @@ int main(int argc, char *argv[]) {
                 return log_tests_skipped("cgroupfs not available");
 
         assert_se(runtime_dir = setup_fake_runtime_dir());
-        test_execute_path = path_join_many(get_testdata_dir(), "test-execute");
+        test_execute_path = path_join(get_testdata_dir(), "test-execute");
         assert_se(set_unit_path(test_execute_path) >= 0);
 
         /* Unset VAR1, VAR2 and VAR3 which are used in the PassEnvironment test
index e8db0bad64ff5c955bcc58be03a321d04ee0c57c..cddbfa7022416b65c21eb60d2d27ae5ec7ac8c63 100644 (file)
@@ -25,7 +25,7 @@ static void test_basic_parsing(void) {
         _cleanup_free_ char *journal_data_path = NULL;
         int r;
 
-        journal_data_path = path_join_many(get_testdata_dir(), "journal-data/journal-1.txt");
+        journal_data_path = path_join(get_testdata_dir(), "journal-data/journal-1.txt");
         imp.fd = open(journal_data_path, O_RDONLY|O_CLOEXEC);
         assert_se(imp.fd >= 0);
 
@@ -56,7 +56,7 @@ static void test_bad_input(void) {
         _cleanup_free_ char *journal_data_path = NULL;
         int r;
 
-        journal_data_path = path_join_many(get_testdata_dir(), "journal-data/journal-2.txt");
+        journal_data_path = path_join(get_testdata_dir(), "journal-data/journal-2.txt");
         imp.fd = open(journal_data_path, O_RDONLY|O_CLOEXEC);
         assert_se(imp.fd >= 0);
 
index ccc38752bf542df65e7d1c52f2a84c902c28ba3a..767a9fbbef97922b881d31293a9c206a14c73b26 100644 (file)
@@ -123,9 +123,9 @@ static void test_path_is_mount_point(void) {
 
         /* file mountpoints */
         assert_se(mkdtemp(tmp_dir) != NULL);
-        file1 = path_join_many(tmp_dir, "file1");
+        file1 = path_join(tmp_dir, "file1");
         assert_se(file1);
-        file2 = path_join_many(tmp_dir, "file2");
+        file2 = path_join(tmp_dir, "file2");
         assert_se(file2);
         fd = open(file1, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0664);
         assert_se(fd > 0);
@@ -133,10 +133,10 @@ static void test_path_is_mount_point(void) {
         fd = open(file2, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0664);
         assert_se(fd > 0);
         close(fd);
-        link1 = path_join_many(tmp_dir, "link1");
+        link1 = path_join(tmp_dir, "link1");
         assert_se(link1);
         assert_se(symlink("file1", link1) == 0);
-        link2 = path_join_many(tmp_dir, "link2");
+        link2 = path_join(tmp_dir, "link2");
         assert_se(link1);
         assert_se(symlink("file2", link2) == 0);
 
@@ -146,16 +146,16 @@ static void test_path_is_mount_point(void) {
         assert_se(path_is_mount_point(link1, NULL, 0) == 0);
 
         /* directory mountpoints */
-        dir1 = path_join_many(tmp_dir, "dir1");
+        dir1 = path_join(tmp_dir, "dir1");
         assert_se(dir1);
         assert_se(mkdir(dir1, 0755) == 0);
-        dirlink1 = path_join_many(tmp_dir, "dirlink1");
+        dirlink1 = path_join(tmp_dir, "dirlink1");
         assert_se(dirlink1);
         assert_se(symlink("dir1", dirlink1) == 0);
-        dirlink1file = path_join_many(tmp_dir, "dirlink1file");
+        dirlink1file = path_join(tmp_dir, "dirlink1file");
         assert_se(dirlink1file);
         assert_se(symlink("dirlink1/file", dirlink1file) == 0);
-        dir2 = path_join_many(tmp_dir, "dir2");
+        dir2 = path_join(tmp_dir, "dir2");
         assert_se(dir2);
         assert_se(mkdir(dir2, 0755) == 0);
 
@@ -165,7 +165,7 @@ static void test_path_is_mount_point(void) {
         assert_se(path_is_mount_point(dirlink1, NULL, 0) == 0);
 
         /* file in subdirectory mountpoints */
-        dir1file = path_join_many(dir1, "file");
+        dir1file = path_join(dir1, "file");
         assert_se(dir1file);
         fd = open(dir1file, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0664);
         assert_se(fd > 0);
@@ -206,7 +206,7 @@ static void test_path_is_mount_point(void) {
                 assert_se(rlt == 1);
 
                 /* dirs */
-                dir2file = path_join_many(dir2, "file");
+                dir2file = path_join(dir2, "file");
                 assert_se(dir2file);
                 fd = open(dir2file, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0664);
                 assert_se(fd > 0);
index cfe8cc05107abbfe13b8c24c753bfabda85912b3..236aeff13e77e2ab7a2cc6ec3fbd546b06efce7e 100644 (file)
@@ -232,23 +232,38 @@ static void test_prefixes(void) {
 
 static void test_path_join(void) {
 
-#define test_join(root, path, rest, expected) {  \
+#define test_join(expected, ...) {        \
                 _cleanup_free_ char *z = NULL;   \
-                z = path_join_many(strempty(root), path, rest); \
+                z = path_join(__VA_ARGS__); \
+                log_debug("got \"%s\", expected \"%s\"", z, expected); \
                 assert_se(streq(z, expected));   \
         }
 
-        test_join("/root", "/a/b", "/c", "/root/a/b/c");
-        test_join("/root", "a/b", "c", "/root/a/b/c");
-        test_join("/root", "/a/b", "c", "/root/a/b/c");
-        test_join("/root", "/", "c", "/root/c");
-        test_join("/root", "/", NULL, "/root/");
-
-        test_join(NULL, "/a/b", "/c", "/a/b/c");
-        test_join(NULL, "a/b", "c", "a/b/c");
-        test_join(NULL, "/a/b", "c", "/a/b/c");
-        test_join(NULL, "/", "c", "/c");
-        test_join(NULL, "/", NULL, "/");
+        test_join("/root/a/b/c", "/root", "/a/b", "/c");
+        test_join("/root/a/b/c", "/root", "a/b", "c");
+        test_join("/root/a/b/c", "/root", "/a/b", "c");
+        test_join("/root/c",     "/root", "/", "c");
+        test_join("/root/",      "/root", "/", NULL);
+
+        test_join("/a/b/c", "", "/a/b", "/c");
+        test_join("a/b/c",  "", "a/b", "c");
+        test_join("/a/b/c", "", "/a/b", "c");
+        test_join("/c",     "", "/", "c");
+        test_join("/",      "", "/", NULL);
+
+        test_join("", "", NULL);
+
+        test_join("foo/bar", "foo", "bar");
+        test_join("foo/bar", "", "foo", "bar");
+        test_join("foo/bar", "", "foo", "", "bar", "");
+        test_join("foo/bar", "", "", "", "", "foo", "", "", "", "bar", "", "", "");
+
+        test_join("//foo///bar//",         "", "/", "", "/foo/", "", "/", "", "/bar/", "", "/", "");
+        test_join("/foo/bar/",             "/", "foo", "/", "bar", "/");
+        test_join("foo/bar/baz",           "foo", "bar", "baz");
+        test_join("foo/bar/baz",           "foo/", "bar", "/baz");
+        test_join("foo//bar//baz",         "foo/", "/bar/", "/baz");
+        test_join("//foo////bar////baz//", "//foo/", "///bar/", "///baz//");
 }
 
 static void test_fsck_exists(void) {
@@ -567,43 +582,6 @@ static void test_path_startswith_set(void) {
         assert_se(streq_ptr(PATH_STARTSWITH_SET("/foo2/bar", "/foo/quux", "", "/zzz"), NULL));
 }
 
-static void test_path_join_many(void) {
-        char *j;
-
-        assert_se(streq_ptr(j = path_join_many("", NULL), ""));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("foo", NULL), "foo"));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("foo", "bar"), "foo/bar"));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("", "foo", "", "bar", ""), "foo/bar"));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("", "", "", "", "foo", "", "", "", "bar", "", "", ""), "foo/bar"));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("", "/", "", "/foo/", "", "/", "", "/bar/", "", "/", ""), "//foo///bar//"));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("/", "foo", "/", "bar", "/"), "/foo/bar/"));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("foo", "bar", "baz"), "foo/bar/baz"));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("foo/", "bar", "/baz"), "foo/bar/baz"));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("foo/", "/bar/", "/baz"), "foo//bar//baz"));
-        free(j);
-
-        assert_se(streq_ptr(j = path_join_many("//foo/", "///bar/", "///baz//"), "//foo////bar////baz//"));
-        free(j);
-}
-
 int main(int argc, char **argv) {
         test_setup_logging(LOG_DEBUG);
 
@@ -625,7 +603,6 @@ int main(int argc, char **argv) {
         test_skip_dev_prefix();
         test_empty_or_root();
         test_path_startswith_set();
-        test_path_join_many();
 
         test_systemd_installation_has_version(argv[1]); /* NULL is OK */
 
index 6d8dab3c7012fd3a5390e62001aca25426bee442..07a0e413ee357db9e9e204ceac796e40172282a4 100644 (file)
@@ -252,7 +252,7 @@ int main(int argc, char *argv[]) {
 
         test_setup_logging(LOG_INFO);
 
-        test_path = path_join_many(get_testdata_dir(), "test-path");
+        test_path = path_join(get_testdata_dir(), "test-path");
         assert_se(set_unit_path(test_path) >= 0);
         assert_se(runtime_dir = setup_fake_runtime_dir());
 
index 2b53c1bae8b1ad8207d7cd0af00a3e8ca4aeedb7..6ab5758edec6cd2110d7a2790a538bd294bce94f 100644 (file)
@@ -16,7 +16,7 @@ static void test_mount_points_list(const char *fname) {
         log_info("/* %s(\"%s\") */", __func__, fname ?: "/proc/self/mountinfo");
 
         if (fname)
-                fname = testdata_fname = path_join_many(get_testdata_dir(), fname);
+                fname = testdata_fname = path_join(get_testdata_dir(), fname);
 
         LIST_HEAD_INIT(mp_list_head);
         assert_se(mount_points_list_get(fname, &mp_list_head) >= 0);
@@ -38,7 +38,7 @@ static void test_swap_list(const char *fname) {
         log_info("/* %s(\"%s\") */", __func__, fname ?: "/proc/swaps");
 
         if (fname)
-                fname = testdata_fname = path_join_many(get_testdata_dir(), fname);
+                fname = testdata_fname = path_join(get_testdata_dir(), fname);
 
         LIST_HEAD_INIT(mp_list_head);
         assert_se(swap_list_get(fname, &mp_list_head) >= 0);
index 854ca2d33c6fc69d86b45513cce5117d63c64255..ce17d6972dad67c6d5ebe5895dd71dd74992dbc5 100644 (file)
@@ -1844,7 +1844,7 @@ static int item_do(Item *i, int fd, const char *path, fdaction_t action) {
                         else {
                                 _cleanup_free_ char *de_path = NULL;
 
-                                de_path = path_join_many(path, de->d_name);
+                                de_path = path_join(path, de->d_name);
                                 if (!de_path)
                                         q = log_oom();
                                 else
index b5252926cd4fb21a1878287cf445cb087bd7f537..840d20beac53aaf09a229bc8948fce215376da02 100644 (file)
@@ -633,7 +633,7 @@ int udev_event_spawn(struct udev_event *event,
         if (!path_is_absolute(argv[0])) {
                 char *program;
 
-                program = path_join_many(UDEVLIBEXECDIR, argv[0]);
+                program = path_join(UDEVLIBEXECDIR, argv[0]);
                 if (!program)
                         return log_oom();
 
index a12dbcfc4432c18214e5631afc18f2d7bf17b434..c11eb8c1acee439498d4d1fbab8b3071bd297870 100644 (file)
@@ -200,10 +200,10 @@ static int link_update(sd_device *dev, const char *slink, bool add) {
                 return log_device_debug_errno(dev, r, "Failed to get id_filename: %m");
 
         util_path_encode(slink + STRLEN("/dev"), name_enc, sizeof(name_enc));
-        dirname = path_join_many("/run/udev/links/", name_enc);
+        dirname = path_join("/run/udev/links/", name_enc);
         if (!dirname)
                 return log_oom();
-        filename = path_join_many(dirname, id_filename);
+        filename = path_join(dirname, id_filename);
         if (!filename)
                 return log_oom();
 
index 14fb241a2905d9816755040503a89468b88d631b..f13a08f3f93a347182e171b10932a61bee4f6dee 100644 (file)
@@ -35,7 +35,7 @@ static int exec_list(sd_device_enumerator *e, const char *action, Set *settle_se
                 if (arg_dry_run)
                         continue;
 
-                filename = path_join_many(syspath, "uevent");
+                filename = path_join(syspath, "uevent");
                 if (!filename)
                         return log_oom();
 
index 22f43740c372a9b233bd4e9e9398ac51b2666e67..ef0dc564ce6a50509c818ab000e24b7b6a4fe07e 100644 (file)
@@ -14,7 +14,7 @@ int find_device(const char *id, const char *prefix, sd_device **ret) {
         assert(ret);
 
         if (prefix && !path_startswith(id, prefix)) {
-                buf = path_join_many(prefix, id);
+                buf = path_join(prefix, id);
                 if (!buf)
                         return -ENOMEM;
                 id = buf;