1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00

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

Inspired by 83b94cf10e
This commit is contained in:
Lennart Poettering 2022-09-20 13:39:29 +02:00 committed by Yu Watanabe
parent 7bb99e23e5
commit 739d9cae40

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);
}