From 739d9cae407eb5e33f27e290235b6d096feda410 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Sep 2022 13:39:29 +0200 Subject: [PATCH] recurse-dir: use fd_reopen() at one more place Inspired by 83b94cf10e4f76b2b415bc70bf65f1c28698b97c --- src/basic/recurse-dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c index efa1797b7ba..d16ca98f67a 100644 --- a/src/basic/recurse-dir.c +++ b/src/basic/recurse-dir.c @@ -255,9 +255,9 @@ int recurse_dir( * directory fd — which should be riskless now that we pinned the * inode. */ - subdir_fd = openat(AT_FDCWD, FORMAT_PROC_FD_PATH(inode_fd), O_DIRECTORY|O_CLOEXEC); + subdir_fd = fd_reopen(inode_fd, O_DIRECTORY|O_CLOEXEC); if (subdir_fd < 0) - return -errno; + return subdir_fd; inode_fd = safe_close(inode_fd); }