Cygwin: FIFO: tweak fcntl and dup when O_PATH is set

fhandler_fifo::fcntl and fhandler_fifo::dup now call the corresponding
fhandler_base methods if the FIFO was opened with the O_PATH flag.
This commit is contained in:
Ken Brown 2020-01-23 16:31:05 +00:00 committed by Corinna Vinschen
parent 5fb3790422
commit 7d68ffadd3
1 changed files with 4 additions and 1 deletions

View File

@ -997,7 +997,7 @@ fhandler_fifo::close ()
int
fhandler_fifo::fcntl (int cmd, intptr_t arg)
{
if (cmd != F_SETFL || nohandle ())
if (cmd != F_SETFL || nohandle () || (get_flags () & O_PATH))
return fhandler_base::fcntl (cmd, arg);
const bool was_nonblocking = is_nonblocking ();
@ -1014,6 +1014,9 @@ fhandler_fifo::dup (fhandler_base *child, int flags)
int ret = -1;
fhandler_fifo *fhf = NULL;
if (get_flags () & O_PATH)
return fhandler_base::dup (child, flags);
if (fhandler_base::dup (child, flags))
goto out;