fd-util: Add extra shortcut to path_is_root_at()

This commit is contained in:
Daan De Meyer
2023-06-13 16:13:43 +02:00
parent e089efd7a7
commit 549a9a671a
+2 -2
View File
@@ -900,9 +900,9 @@ int path_is_root_at(int dir_fd, const char *path) {
assert(dir_fd >= 0 || dir_fd == AT_FDCWD);
if (!isempty(path)) {
fd = openat(dir_fd, path, O_PATH|O_CLOEXEC);
fd = openat(dir_fd, path, O_PATH|O_DIRECTORY|O_CLOEXEC);
if (fd < 0)
return -errno;
return errno == ENOTDIR ? false : -errno;
dir_fd = fd;
}