repart: fix incorrect error code propagation
authorLennart Poettering <lennart@poettering.net>
Mon, 19 Apr 2021 15:35:54 +0000 (17:35 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 May 2021 12:51:08 +0000 (14:51 +0200)
(cherry picked from commit a0ff9971802b664aaa12481c46cec11eae77ea51)

src/partition/repart.c

index 9555d00f7e0cdbe82dada00a1094b9ec23230412..cf3a43b80a370b254e04b856e8a996bf40023fb8 100644 (file)
@@ -2706,7 +2706,7 @@ static int do_copy_files(Partition *p, const char *fs) {
 
                         pfd = chase_symlinks_and_open(dn, fs, CHASE_PREFIX_ROOT|CHASE_WARN, O_RDONLY|O_DIRECTORY|O_CLOEXEC, NULL);
                         if (pfd < 0)
-                                return log_error_errno(tfd, "Failed to open parent directory of target: %m");
+                                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);
                         if (tfd < 0)