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 739e89cbe6
commit aa55d22cb5

View File

@ -451,11 +451,18 @@ 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:
reader = true; if (!query_open ())
reader = true;
break; break;
case O_WRONLY: case O_WRONLY:
writer = true; writer = true;
@ -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 ();