libc: Signal ELOOP if file not found and O_NOFOLLOW set

This commit is contained in:
Alexander Senier 2017-07-04 21:11:57 +02:00 committed by Christian Helmuth
parent 66f3742112
commit 520eedb829
1 changed files with 4 additions and 0 deletions

View File

@ -222,6 +222,10 @@ Libc::File_descriptor *Libc::Vfs_plugin::open(char const *path, int flags,
case Result::OPEN_ERR_UNACCESSIBLE:
{
if (!(flags & O_CREAT)) {
if (flags & O_NOFOLLOW) {
errno = ELOOP;
return 0;
}
errno = ENOENT;
return 0;
}