summaryrefslogtreecommitdiffstats
path: root/src/shared/data-fd-util.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/shared/data-fd-util.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/shared/data-fd-util.c b/src/shared/data-fd-util.c
index b948ab6cc4..4ef4100564 100644
--- a/src/shared/data-fd-util.c
+++ b/src/shared/data-fd-util.c
@@ -200,17 +200,11 @@ int memfd_clone_fd(int fd, const char *name, int mode) {
return r;
if (ro) {
- _cleanup_close_ int rfd = -EBADF;
-
r = memfd_set_sealed(mfd);
if (r < 0)
return r;
- rfd = fd_reopen(mfd, mode);
- if (rfd < 0)
- return rfd;
-
- return TAKE_FD(rfd);
+ return fd_reopen(mfd, mode);
}
off_t f = lseek(mfd, 0, SEEK_SET);