summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2020-01-23 16:31:05 +0000
committerCorinna Vinschen <corinna@vinschen.de>2020-01-24 11:24:18 +0100
commit7d68ffadd3fbc9b8dcd189d4a20c12a9cd1ed743 (patch)
treeae3c15a1843d54bea0b9439d11736939576f01cc
parent5fb3790422495ba55390bbac32b60bcea908ef70 (diff)
downloadcygnal-7d68ffadd3fbc9b8dcd189d4a20c12a9cd1ed743.tar.gz
cygnal-7d68ffadd3fbc9b8dcd189d4a20c12a9cd1ed743.tar.bz2
cygnal-7d68ffadd3fbc9b8dcd189d4a20c12a9cd1ed743.zip
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.
-rw-r--r--winsup/cygwin/fhandler_fifo.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 8cbab353c..a338f12cc 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -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;