mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 18:06:50 +00:00
libc: handle O_CREAT|O_NOFOLLOW in open correctly
We return ELOOP if the file already exists on open(...,O_CREAT|O_NOFOLLOW). Fixes #2458
This commit is contained in:
parent
51dcf5f7f8
commit
87c19cb11a
@ -196,7 +196,12 @@ Libc::File_descriptor *Libc::Vfs_plugin::open(char const *path, int flags,
|
|||||||
case Result::OPEN_ERR_EXISTS:
|
case Result::OPEN_ERR_EXISTS:
|
||||||
|
|
||||||
/* file has been created by someone else in the meantime */
|
/* file has been created by someone else in the meantime */
|
||||||
break;
|
if (flags & O_NOFOLLOW) {
|
||||||
|
errno = ELOOP;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
errno = EEXIST;
|
||||||
|
return 0;
|
||||||
|
|
||||||
case Result::OPEN_ERR_NO_PERM: errno = EPERM; return 0;
|
case Result::OPEN_ERR_NO_PERM: errno = EPERM; return 0;
|
||||||
case Result::OPEN_ERR_UNACCESSIBLE: errno = ENOENT; return 0;
|
case Result::OPEN_ERR_UNACCESSIBLE: errno = ENOENT; return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user