aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2019-06-26 20:44:16 -0400
committerKen Brown <kbrown@cornell.edu>2019-06-26 20:51:42 -0400
commitc4d5b61f1609589d98857f2ce2d8d7bcd94f2fa3 (patch)
tree38bb58cb5e7500ac524eb482dfe5b8bb9c3606d7
parentfddcd84fd4888eda45cd0e99ffc0c28d64b1b664 (diff)
downloadnewlib-c4d5b61f1609589d98857f2ce2d8d7bcd94f2fa3.zip
newlib-c4d5b61f1609589d98857f2ce2d8d7bcd94f2fa3.tar.gz
newlib-c4d5b61f1609589d98857f2ce2d8d7bcd94f2fa3.tar.bz2
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.
-rw-r--r--winsup/cygwin/fhandler_fifo.cc11
-rw-r--r--winsup/cygwin/release/3.0.813
2 files changed, 23 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 5733ec7..9112314 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -85,11 +85,20 @@ fhandler_fifo::open (int flags, mode_t)
bool reader, writer, duplexer;
DWORD open_mode = FILE_FLAG_OVERLAPPED;
+ if (flags & O_PATH)
+ {
+ query_open (query_read_attributes);
+ nohandle (true);
+ }
+
/* Determine what we're doing with this fhandler: reading, writing, both */
switch (flags & O_ACCMODE)
{
case O_RDONLY:
- reader = true;
+ if (query_open ())
+ reader = false;
+ else
+ reader = true;
writer = false;
duplexer = false;
break;
diff --git a/winsup/cygwin/release/3.0.8 b/winsup/cygwin/release/3.0.8
new file mode 100644
index 0000000..e3734c9
--- /dev/null
+++ b/winsup/cygwin/release/3.0.8
@@ -0,0 +1,13 @@
+What's new:
+-----------
+
+
+What changed:
+-------------
+
+
+Bug Fixes
+---------
+
+- Fix a hang when opening a FIFO with O_PATH.
+ Addresses: https://cygwin.com/ml/cygwin-developers/2019-06/msg00001.html