Cygwin: honor the O_PATH flag when opening a FIFO

Previously fhandler_fifo::open would treat the FIFO as a reader and
would block, waiting for a writer.
This commit is contained in:
Ken Brown 2019-06-27 07:46:14 -04:00
parent d07d375bc4
commit c2b392c600
1 changed files with 10 additions and 1 deletions

View File

@ -451,11 +451,18 @@ fhandler_fifo::open (int flags, mode_t)
error_set_errno
} res;
if (flags & O_PATH)
{
query_open (query_read_attributes);
nohandle (true);
}
/* Determine what we're doing with this fhandler: reading, writing, both */
switch (flags & O_ACCMODE)
{
case O_RDONLY:
reader = true;
if (!query_open ())
reader = true;
break;
case O_WRONLY:
writer = true;
@ -577,6 +584,8 @@ fhandler_fifo::open (int flags, mode_t)
}
}
}
if (query_open ())
res = success;
out:
if (res == error_set_errno)
__seterrno ();