[PATCH 0/5] Some revisions for pty and console code.

2021-01-15 Thread Takashi Yano via Cygwin-patches
Takashi Yano (5): Cygwin: pty: Add workaround for rlwrap 0.40 or later. Cygwin: console: Revise the code to switch xterm mode. Cygwin: pty: Make close_pseudoconsole() be a static member function. Cygwin: pty: Prevent pty from changing code page of parent console. Cygwin: pty: Make master

[PATCH 1/5] Cygwin: pty: Add workaround for rlwrap 0.40 or later.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- The workaround for rlwrap introduced by commit 8199b0cc does not take effect for rlwrap 0.40 or later. This patch add a workaround for rlwrap 0.40 or later as well. --- winsup/cygwin/fhandler_tty.cc | 5 + 1 file changed, 5 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc

[PATCH 2/5] Cygwin: console: Revise the code to switch xterm mode.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- If application changes the console mode, mode management introduced by commit 10d8c278 will be corrupted. For example, stdout of jansi v2.0.1 or later is piped to less, jansi resets the xterm mode flag ENABLE_VIRTUAL_TERMINA_PROCESSING when jansi is terminated. This causes garbled output

[PATCH 3/5] Cygwin: pty: Make close_pseudoconsole() be a static member function.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- The function close_pseudoconsole() should be static so that it can be safely called in spawn.cc even after the fhandler_pty_slave instance has been deleted. That is, there is a problem with the current code. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 3 ++-

[PATCH 4/5] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- After commit 232fde0e, pty changes console code page when the first non-cygwin app is executed. If pty is started in real console device, pty changes the code page of root console. This causes very annoying result because changing code page changes the font of command prompt if console

[PATCH 5/5] Cygwin: pty: Make master thread functions be static.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- The functions pty_master_thread() and pty_master_fwd_thread() should be static (i.e. should not access class member) because the instance is deleted if the master is dup()'ed and the first master is closed. In this case, because the dup()'ed instance still exists, these master threads

[PATCH] Cygwin: pty: Set input_available_event only for cygwin pipe.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- cat exits immediately in the following senario. 1) Execute env CYGWIN=disable_pcon script 2) Execute cmd.exe 3) Execute cat in cmd.exe. This is caused by setting input_available_event for the pipe for non-cygwin app. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc

[PATCH 01/11] syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE first

2021-01-15 Thread Ben Wijen
--- winsup/cygwin/ntdll.h | 3 ++- winsup/cygwin/syscalls.cc | 20 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h index d4f6aaf45..7eee383dd 100644 --- a/winsup/cygwin/ntdll.h +++ b/winsup/cygwin/ntdll.h @@

[PATCH 04/11] syscalls.cc: Use EISDIR

2021-01-15 Thread Ben Wijen
This is the non-POSIX value returned by Linux since 2.1.132. --- winsup/cygwin/syscalls.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 227d1a911..043ccdb99 100644 --- a/winsup/cygwin/syscalls.cc +++

[PATCH 03/11] syscalls.cc: Fix num_links

2021-01-15 Thread Ben Wijen
NtQueryInformationFile on fh_ro needs FILE_READ_ATTRIBUTES to succeed. --- winsup/cygwin/syscalls.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 0e89b4f44..227d1a911 100644 --- a/winsup/cygwin/syscalls.cc +++

[PATCH 06/11] cxx.cc: Fix dynamic initialization for static local variables

2021-01-15 Thread Ben Wijen
The old implementation for __cxa_guard_acquire did not return 1, therefore dynamic initialization was never performed. If concurrent-safe dynamic initialisation is ever needed, CXX ABI must be followed when re-implementing __cxa_guard_acquire (et al.) --- winsup/cygwin/Makefile.in | 2 +-

[PATCH 07/11] syscalls.cc: Implement non-path_conv dependent _unlink_nt

2021-01-15 Thread Ben Wijen
Implement _unlink_nt: wich does not depend on patch_conv --- winsup/cygwin/fhandler_disk_file.cc | 4 +- winsup/cygwin/forkable.cc | 4 +- winsup/cygwin/syscalls.cc | 239 ++-- 3 files changed, 228 insertions(+), 19 deletions(-) diff --git

[PATCH 08/11] path.cc: Allow to skip filesystem checks

2021-01-15 Thread Ben Wijen
When file attributes are of no concern, there is no point to query them. --- winsup/cygwin/path.cc | 3 +++ winsup/cygwin/path.h | 1 + 2 files changed, 4 insertions(+) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index abd3687df..f00707e86 100644 --- a/winsup/cygwin/path.cc +++

[PATCH 09/11] mount.cc: Implement poor-man's cache

2021-01-15 Thread Ben Wijen
Try to avoid NtQueryVolumeInformationFile. --- winsup/cygwin/mount.cc | 78 -- winsup/cygwin/mount.h | 2 +- winsup/cygwin/path.cc | 2 +- winsup/cygwin/path.h | 1 + 4 files changed, 56 insertions(+), 27 deletions(-) diff --git

[PATCH 10/11] syscalls.cc: Expose shallow-pathconv unlink_nt

2021-01-15 Thread Ben Wijen
Not having to query file information improves unlink speed. --- winsup/cygwin/syscalls.cc | 68 --- 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 79e4a4422..8aecdf453 100644 ---

[PATCH 11/11] dir.cc: Try unlink_nt first

2021-01-15 Thread Ben Wijen
Speedup deletion of directories. --- winsup/cygwin/dir.cc | 6 ++ 1 file changed, 6 insertions(+) diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index f912a9e47..2e7da3638 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -22,6 +22,8 @@ details. */ #include

[PATCH] Cygwin: document a recent bug fix

2021-01-15 Thread Ken Brown via Cygwin-patches
This documents commit b951adce, "Cygwin: add flag to indicate reparse points unknown to WinAPI". --- winsup/cygwin/release/3.2.0 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/winsup/cygwin/release/3.2.0 b/winsup/cygwin/release/3.2.0 index 132d5c810..c18a848de 100644 ---

Re: [PATCH] Cygwin: document a recent bug fix

2021-01-15 Thread Ken Brown via Cygwin-patches
On 1/15/2021 12:42 PM, Ken Brown via Cygwin-patches wrote: This documents commit b951adce, "Cygwin: add flag to indicate reparse points unknown to WinAPI". Sorry, there's a mistake in the commit message. A corrected version is on the way. Ken

[PATCH] Cygwin: document a recent bug fix

2021-01-15 Thread Ken Brown via Cygwin-patches
This documents commit aec64798, "Cygwin: add flag to indicate reparse points unknown to WinAPI". --- winsup/cygwin/release/3.2.0 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/winsup/cygwin/release/3.2.0 b/winsup/cygwin/release/3.2.0 index 132d5c810..c18a848de 100644 ---