]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
copy: propagate error in fd_copy_directory() 28117/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 22 Jun 2023 07:13:29 +0000 (16:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 23 Jun 2023 01:11:17 +0000 (10:11 +0900)
Follow-up for 01428141ba42a06d22f2c0e0df26049e700f4098.

Fixes CID#1513190.

src/shared/copy.c

index 9d3db2d77165b6aab9e8e7bbcca188c096db5ddf..241a2d112b755542ac503200bcfc24c47f494c5b 100644 (file)
@@ -1084,6 +1084,9 @@ finish:
                         return -errno;
         }
 
+        if (r < 0)
+                return r;
+
         return copy_flags & COPY_LOCK_BSD ? TAKE_FD(fdt) : 0;
 }