]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portable: always reopen fd of release file 27201/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 8 Apr 2023 20:55:17 +0000 (05:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 10 Apr 2023 20:17:52 +0000 (05:17 +0900)
To make it support the case that the fd is O_PATH.

src/portable/portabled-image-bus.c

index 6c4cb6ec9de8acf96011a71a1a5326a92730f294..be8e65df3f56f9c47545d6834679b09379a7c895 100644 (file)
@@ -83,9 +83,9 @@ static int append_fd(sd_bus_message *m, PortableMetadata *d) {
         if (d) {
                 assert(d->fd >= 0);
 
-                f = take_fdopen(&d->fd, "r");
-                if (!f)
-                        return -errno;
+                r = fdopen_independent(d->fd, "r", &f);
+                if (r < 0)
+                        return r;
 
                 r = read_full_stream(f, &buf, &n);
                 if (r < 0)