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:
parent
739e89cbe6
commit
aa55d22cb5
|
@ -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 ();
|
||||||
|
|
Loading…
Reference in New Issue