recurse-dir: use fd_reopen() at one more place

Inspired by 83b94cf10e
This commit is contained in:
Lennart Poettering
2022-09-21 00:55:23 +09:00
committed by Yu Watanabe
parent 7bb99e23e5
commit 739d9cae40
+2 -2
View File
@@ -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);
}