mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-20 06:07:59 +00:00
libc_pipe: ignore some flags in 'fcntl()'
Ignore file access mode and file creation flags for the F_SETFL command. Fixes #2136
This commit is contained in:
parent
964239aa7a
commit
44d4bf7a1b
@ -246,12 +246,18 @@ namespace Libc_pipe {
|
|||||||
|
|
||||||
case F_SETFL:
|
case F_SETFL:
|
||||||
{
|
{
|
||||||
constexpr long supported_flags = O_NONBLOCK;
|
/*
|
||||||
|
* O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_TRUNC, O_EXCL
|
||||||
|
* are ignored
|
||||||
|
*/
|
||||||
|
constexpr long supported_flags = O_NONBLOCK
|
||||||
|
| O_RDONLY | O_WRONLY | O_RDWR
|
||||||
|
| O_CREAT | O_TRUNC | O_EXCL;
|
||||||
|
|
||||||
context(pipefdo)->set_nonblock(arg & O_NONBLOCK);
|
context(pipefdo)->set_nonblock(arg & O_NONBLOCK);
|
||||||
|
|
||||||
if ((arg & ~supported_flags) == 0)
|
if ((arg & ~supported_flags) == 0)
|
||||||
break;
|
return 0;
|
||||||
|
|
||||||
/* unsupported flags present */
|
/* unsupported flags present */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user