From: Lennart Poettering Date: Fri, 16 Jan 2026 16:55:47 +0000 (+0100) Subject: chase: extend coverage of the root fd shortcut X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c67abc9c43d2761af9f58df57eeee96b0f045f98;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/basic/chase.c b/src/basic/chase.c index 323e4623754..f360cc26a3c 100644 --- a/src/basic/chase.c +++ b/src/basic/chase.c @@ -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() */