From: Yu Watanabe Date: Sat, 8 Apr 2023 20:55:17 +0000 (+0900) Subject: portable: always reopen fd of release file X-Git-Tag: v254-rc1~767^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F27201%2Fhead;p=thirdparty%2Fsystemd.git portable: always reopen fd of release file To make it support the case that the fd is O_PATH. --- diff --git a/src/portable/portabled-image-bus.c b/src/portable/portabled-image-bus.c index 6c4cb6ec9de..be8e65df3f5 100644 --- a/src/portable/portabled-image-bus.c +++ b/src/portable/portabled-image-bus.c @@ -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)