libroot/posix: fchdir() should not accept AT_FDCWD.

It doesn't make sense to change directories to the current one.

Should fix #19059.
This commit is contained in:
Augustin Cavalier
2026-01-08 18:21:06 -05:00
parent 988d9d80b1
commit 256ab7351b
@@ -23,6 +23,8 @@ chdir(const char *path)
int
fchdir(int fd)
{
if (fd < 0)
RETURN_AND_SET_ERRNO(EBADF);
RETURN_AND_SET_ERRNO(_kern_setcwd(fd, NULL));
}