4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-26 09:07:34 +08:00
Ken Brown 5781871775 Cygwin: select: don't report read ready on a FIFO never opened for writing
According to POSIX and the Linux man page, select(2) is supposed to
report read ready if a file is at EOF.  In the case of a FIFO, this
means that the pipe is empty and there are no writers.  But there
seems to be an undocumented exception, observed on Linux and other
platforms:  If no writer has ever been opened, then select(2) does not
report read ready.  This can happen if a reader is opened with
O_NONBLOCK before any writers have opened.

This commit makes Cygwin consistent with those other platforms by
introducing a special EOF test, fhandler_fifo::select_hit_eof, which
returns false if there's never been a writer opened.

To implement this we use a new variable '_writer_opened' in the FIFO's
shared memory, which is set to 1 the first time a writer opens.  New
methods writer_opened() and set_writer_opened() are used to test and
set this variable.

Addresses: https://cygwin.com/pipermail/cygwin/2022-September/252223.html
2022-10-19 08:17:50 -04:00

43 lines
1.9 KiB
Groff

Bug Fixes
---------
- Fix a bug in fhandler_dev_clipboard::read() that the second read
fails with 'Bad address'.
Addresses: https://cygwin.com/pipermail/cygwin/2021-December/250141.html
- Convert UNC path prefix back to drive letter in symlink_info::check().
This solves the following issues:
Addresses: https://cygwin.com/pipermail/cygwin/2021-November/250087.html
https://cygwin.com/pipermail/cygwin/2021-December/250103.html
- Fix a bug in pty code that input is wrongly sent to io_handle_nat
rather than io_handle while neither read() nor select() is called
after the cygwin app is started from non-cygwin app.
Addresses: https://cygwin.com/pipermail/cygwin-patches/2021q4/011587.html
- Avoid a crash when NtQueryInformationProcess returns invalid handle data.
Addresses: https://cygwin.com/pipermail/cygwin-patches/2021q4/011611.html
- Ignore INHERIT ACEs when reading the DACL of non-directory files.
Addresses: https://cygwin.com/pipermail/cygwin/2022-January/250363.html
- Fix an "Invalid argument" problem in posix_spawn on i686.
Addresses: https://cygwin.com/pipermail/cygwin/2022-January/250453.html
- Fix handling of AAAA records in Cygwin resolver code using native
windows calls. Also fix various bugs in the resolver.
- Fix a problem creating a dir "foo", if a file (but not a Cygwin symlink)
"foo.lnk" already exists.
Addresses: https://github.com/msys2/msys2-runtime/issues/81
- Fix double free for archetype, which is caused when open() fails.
Addresses: https://cygwin.com/pipermail/cygwin/2022-January/250518.html
- Fix a permission problem when writing DOS attributes on Samba.
Addresses: https://cygwin.com/pipermail/cygwin/2022-January/250629.html
- For Linux compatibility, select(2) no longer reports read ready on a
FIFO that has never been opened for writing.
Addresses: https://cygwin.com/pipermail/cygwin/2022-September/252223.html