]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: don't use basename() when we called path_extract_filename() anyway already
authorLennart Poettering <lennart@poettering.net>
Wed, 21 Apr 2021 21:22:26 +0000 (23:22 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Apr 2021 21:30:46 +0000 (23:30 +0200)
We already have the string, use it.

src/partition/repart.c

index 9e297f19b9a5667a8986f615324803599b697b34..7809641fc8807484c6bfa481a972259a92d4500f 100644 (file)
@@ -2858,7 +2858,7 @@ static int do_copy_files(Partition *p, const char *fs) {
                         if (pfd < 0)
                                 return log_error_errno(pfd, "Failed to open parent directory of target: %m");
 
-                        tfd = openat(pfd, basename(*target), O_CREAT|O_EXCL|O_WRONLY|O_CLOEXEC, 0700);
+                        tfd = openat(pfd, fn, O_CREAT|O_EXCL|O_WRONLY|O_CLOEXEC, 0700);
                         if (tfd < 0)
                                 return log_error_errno(errno, "Failed to create target file '%s': %m", *target);