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