chase: extend coverage of the root fd shortcut

Let's use dir_fd_is_root() to check if we are looking at the real root
fs.
This commit is contained in:
Lennart Poettering
2026-01-17 12:37:39 +01:00
parent ded2531764
commit c67abc9c43
+4 -1
View File
@@ -220,7 +220,10 @@ int chaseat(int dir_fd, const char *path, ChaseFlags flags, char **ret_path, int
*/
_cleanup_close_ int _dir_fd = -EBADF;
if (dir_fd == XAT_FDROOT) {
r = dir_fd_is_root(dir_fd);
if (r < 0)
return r;
if (r > 0) {
/* Shortcut the common case where no root dir is specified, and no special flags are given to
* a regular open() */