]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: use path_join() to join paths 11971/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 12 Mar 2019 08:30:45 +0000 (09:30 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 14 Mar 2019 07:28:18 +0000 (08:28 +0100)
We would say "/boot/efi//loader/entries"...

src/boot/bootctl.c

index ff830dc745981273d7d7ec95964ac5bae7dfa89f..381c234f3b0e5d24167c802ba967e05fe50d7278 100644 (file)
@@ -517,9 +517,9 @@ static int copy_file_with_version_check(const char *from, const char *to, bool f
 }
 
 static int mkdir_one(const char *prefix, const char *suffix) {
-        char *p;
+        _cleanup_free_ char *p = NULL;
 
-        p = strjoina(prefix, "/", suffix);
+        p = path_join(prefix, suffix);
         if (mkdir(p, 0700) < 0) {
                 if (errno != EEXIST)
                         return log_error_errno(errno, "Failed to create \"%s\": %m", p);
@@ -935,7 +935,7 @@ static int install_entries_directories(const char *dollar_boot_path, sd_id128_t
          * partition. Also create the parent directory for entry directories, so that kernel-install
          * knows where to put them. */
 
-        r = mkdir_one(dollar_boot_path, "/loader/entries");
+        r = mkdir_one(dollar_boot_path, "loader/entries");
         if (r < 0)
                 return r;