[PATCH v2] Cygwin: pty: Fix the issue regarding open and close multiple PTYs.

2020-01-13 Thread Takashi Yano
- If two PTYs are opened in the same process and the first one is closed, the helper process for the first PTY remains running. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git

Re: [PATCH] Cygwin: pty: Fix the issue regarding open and close multiple PTYs.

2020-01-13 Thread Takashi Yano
Hi Corinna, On Mon, 13 Jan 2020 16:49:52 +0100 Corinna Vinschen wrote: > But then again, given that Cygwin uses EXTENDED_STARTUPINFO_PRESENT > anyway, wouldn't it makes sense to pass the required handles with > PROC_THREAD_ATTRIBUTE_HANDLE_LIST to avoid having to open the > parent with

[PATCH v2] Cygwin: pty: Add missing CloseHandle() calls.

2020-01-13 Thread Takashi Yano
- PTY code which support pseudo console has a problem that causes handle leaks. Four of these are bug in pty code, and the other one seems to be a bug of Windows10. ClosePseudoConsole() fails to close one internal handle. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 16

[PATCH v2] Cygwin: console: Disable xterm mode for non cygwin process only.

2020-01-13 Thread Takashi Yano
- Special function keys such as arrow keys or function keys do not work in ConEmu with cygwin-connector after commit 6a06c6bc8f8492ea09aa3ae180fe94e4ac265611. This patch fixes the issue. --- winsup/cygwin/fhandler_console.cc | 19 --- winsup/cygwin/fhandler_tty.cc | 10

[PATCH v2] Cygwin: console: Add workaround for broken CSI3J in Win10 1809.

2020-01-13 Thread Takashi Yano
- In Win10 1809, the cursor position sometimes goes out of screen by clear command in console. This seems to be caused by escape sequence CSI3J (ESC[3J). This happens only for 1809. This patch is a workaround for the issue. --- winsup/cygwin/fhandler_console.cc | 12 +

Re: [PATCH] Cygwin: console: Add code to restore console mode on close.

2020-01-13 Thread Takashi Yano
Hi Corinna, welcome back! On Mon, 13 Jan 2020 17:25:53 +0100 Corinna Vinschen wrote: > On Jan 2 22:17, Takashi Yano wrote: > > - The console with 24bit color support has a problem that console > > mode is changed if cygwin process is executed in cmd.exe which > > started in cygwin shell. For

Re: [PATCH] Cygwin: select: Speed up select() call for pty, pipe and fifo.

2020-01-13 Thread Marco Atzeri
Am 13.01.2020 um 17:33 schrieb Corinna Vinschen: On Jan 6 23:38, Takashi Yano wrote: - The slowing down issue of X11 forwarding using ssh -Y, reported in https://www.cygwin.com/ml/cygwin/2019-12/msg00295.html, is due to the change of select() code for pty in the commit

Re: [PATCH v2 0/3] Support opening a symlink with O_PATH | O_NOFOLLOW

2020-01-13 Thread Ken Brown
On 1/13/2020 1:39 PM, Corinna Vinschen wrote: > On Jan 13 19:34, Corinna Vinschen wrote: >> On Jan 13 16:53, Ken Brown wrote: >>> On 1/13/2020 10:28 AM, Corinna Vinschen wrote: On Dec 29 17:56, Ken Brown wrote: > [...] > Note: The man page mentions fchownat and linkat also. linkat

Re: [PATCH v2 0/3] Support opening a symlink with O_PATH | O_NOFOLLOW

2020-01-13 Thread Corinna Vinschen
On Jan 13 19:34, Corinna Vinschen wrote: > On Jan 13 16:53, Ken Brown wrote: > > On 1/13/2020 10:28 AM, Corinna Vinschen wrote: > > > On Dec 29 17:56, Ken Brown wrote: > > >> [...] > > >> Note: The man page mentions fchownat and linkat also. linkat already > > >> supports the AT_EMPTY_PATH flag,

Re: [PATCH v2 0/3] Support opening a symlink with O_PATH | O_NOFOLLOW

2020-01-13 Thread Eric Blake
On 1/13/20 11:44 AM, Ken Brown wrote: I don't think so.  I think we agree, although maybe I didn't express myself clearly enough for that to be obvious.  What confused me was the following paragraph further down in the open(2) man page (still discussing O_PATH):     If pathname is a symbolic

Re: [PATCH v2 0/3] Support opening a symlink with O_PATH | O_NOFOLLOW

2020-01-13 Thread Corinna Vinschen
On Jan 13 16:53, Ken Brown wrote: > On 1/13/2020 10:28 AM, Corinna Vinschen wrote: > > On Dec 29 17:56, Ken Brown wrote: > >> [...] > >> Note: The man page mentions fchownat and linkat also. linkat already > >> supports the AT_EMPTY_PATH flag, so nothing needs to be done. But I > >> don't

Re: [PATCH v2 0/3] Support opening a symlink with O_PATH | O_NOFOLLOW

2020-01-13 Thread Ken Brown
On 1/13/2020 12:24 PM, Eric Blake wrote: > On 1/13/20 10:53 AM, Ken Brown wrote: >> On 1/13/2020 10:28 AM, Corinna Vinschen wrote: >>> Hi Ken, >>> >>> On Dec 29 17:56, Ken Brown wrote: Currently, opening a symlink with O_NOFOLLOW fails with ELOOP. Following Linux, the first patch in this

Re: [PATCH v2 0/3] Support opening a symlink with O_PATH | O_NOFOLLOW

2020-01-13 Thread Eric Blake
On 1/13/20 10:53 AM, Ken Brown wrote: On 1/13/2020 10:28 AM, Corinna Vinschen wrote: Hi Ken, On Dec 29 17:56, Ken Brown wrote: Currently, opening a symlink with O_NOFOLLOW fails with ELOOP. Following Linux, the first patch in this series allows the call to succeed if O_PATH is also specified.

Re: [PATCH] Cygwin: fhandler_socket::open: support the O_PATH flag

2020-01-13 Thread Ken Brown
On 1/13/2020 10:31 AM, Corinna Vinschen wrote: > Hi Ken, > > On Dec 26 15:25, Ken Brown wrote: >> If that flag is not set, fail with EOPNOTSUPP instead of ENXIO. This >> is consistent with POSIX, starting with the 2016 edition. Earlier >> editions were silent on this issue. >> --- >>

Re: [PATCH v2 0/3] Support opening a symlink with O_PATH | O_NOFOLLOW

2020-01-13 Thread Ken Brown
On 1/13/2020 10:28 AM, Corinna Vinschen wrote: > Hi Ken, > > On Dec 29 17:56, Ken Brown wrote: >> Currently, opening a symlink with O_NOFOLLOW fails with ELOOP. >> Following Linux, the first patch in this series allows the call to >> succeed if O_PATH is also specified. >> >> According to the

Re: [PATCH] Cygwin: select: Speed up select() call for pty, pipe and fifo.

2020-01-13 Thread Corinna Vinschen
On Jan 6 23:38, Takashi Yano wrote: > - The slowing down issue of X11 forwarding using ssh -Y, reported > in https://www.cygwin.com/ml/cygwin/2019-12/msg00295.html, > is due to the change of select() code for pty in the commit > 915fcd0ae8d83546ce135131cd25bf6795d97966. cygthread::detach()

Re: [PATCH] Cygwin: console: Make suspending process work properly.

2020-01-13 Thread Corinna Vinschen
On Jan 5 22:25, Takashi Yano wrote: > - After commit f4b47827cf87f055687a0c52a3485d42b3e2b941, suspending > process by Ctrl-Z does not work in console and results in hang up. > This patch fixes the issue. > --- > winsup/cygwin/fhandler_console.cc | 2 ++ > 1 file changed, 2 insertions(+) >

Re: [PATCH] Cygwin: console: Add code to restore console mode on close.

2020-01-13 Thread Corinna Vinschen
Hi Takashi, On Jan 2 22:17, Takashi Yano wrote: > - The console with 24bit color support has a problem that console > mode is changed if cygwin process is executed in cmd.exe which > started in cygwin shell. For example, cursor keys become not > working if bash -> cmd -> true are executed

Re: [PATCH] Cygwin: console: Add workaround for broken CSI3J in Win10 1809.

2020-01-13 Thread Corinna Vinschen
On Jan 1 15:52, Takashi Yano wrote: > - In Win10 1809, the cursor position sometimes goes out of screen > by clear command in console. This seems to be caused by escape > sequence CSI3J (ESC[3J). This happens only for 1809. This patch > is a workaround for the issue. > --- >

Re: [PATCH] Cygwin: console: Disable xterm mode for non cygwin process only.

2020-01-13 Thread Corinna Vinschen
Hi Takashi, On Jan 1 15:51, Takashi Yano wrote: > - Special function keys such as arrow keys or function keys do not > work in ConEmu with cygwin-connector after commit > 6a06c6bc8f8492ea09aa3ae180fe94e4ac265611. This patch fixes the > issue. > --- > [...] > diff --git

Re: [PATCH] Cygwin: pty: Revise the code for setting code page of pseudo console.

2020-01-13 Thread Corinna Vinschen
On Jan 1 15:50, Takashi Yano wrote: > - Fix the problem which overrides the code page setting, reported > in https://www.cygwin.com/ml/cygwin/2019-12/msg00292.html. > --- Pushed. Thanks, Corinna -- Corinna Vinschen Cygwin Maintainer signature.asc Description: PGP signature

Re: [PATCH] Cygwin: pty: Remove destructor for fhandler_pty_master class.

2020-01-13 Thread Corinna Vinschen
On Jan 1 15:49, Takashi Yano wrote: > - The destructor for fhandler_pty_master class does not seem to be > necessary anymore. Therefore, it has been removed. > --- > winsup/cygwin/fhandler.h | 1 - > winsup/cygwin/fhandler_tty.cc | 9 - > 2 files changed, 10 deletions(-) > > diff

Re: [PATCH] Cygwin: pty: Add missing CloseHandle() calls.

2020-01-13 Thread Corinna Vinschen
Hi Takashi, On Jan 1 15:48, Takashi Yano wrote: > --- > winsup/cygwin/fhandler_tty.cc | 22 -- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc > index 65b12fd6c..23156f977 100644 > ---

Re: [PATCH] Cygwin: pty: Fix the issue regarding open and close multiple PTYs.

2020-01-13 Thread Corinna Vinschen
Hi Takashi, On Jan 1 15:47, Takashi Yano wrote: > - If two PTYs are opened in the same process and the first one > is closed, the helper process for the first PTY remains running. > This patch fixes the issue. > --- > [...] > diff --git a/winsup/utils/cygwin-console-helper.cc >

Re: [PATCH] Fixed crash on wine by adding NULL check after memchr

2020-01-13 Thread Corinna Vinschen
On Jan 7 16:34, Arseniy Lartsev wrote: > This is not a joke, there are vendors out there who build software for cygwin > only. Besides, this NULL check is good to have anyway. > --- > winsup/cygwin/path.cc | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/winsup/cygwin/path.cc

Re: [PATCH] Cygwin: Add missing Linux #define of CPU_SETSIZE

2020-01-13 Thread Corinna Vinschen
On Dec 22 22:45, Mark Geisert wrote: > Though our implementation of cpu sets doesn't need it, software from > Linux environments expects this definition to be present. It's > documented on the Linux CPU_SET(3) man page but was left out due to > oversight. > > Addresses

Re: [PATCH] Cygwin: fhandler_socket::open: support the O_PATH flag

2020-01-13 Thread Corinna Vinschen
Hi Ken, On Dec 26 15:25, Ken Brown wrote: > If that flag is not set, fail with EOPNOTSUPP instead of ENXIO. This > is consistent with POSIX, starting with the 2016 edition. Earlier > editions were silent on this issue. > --- > winsup/cygwin/fhandler_socket.cc | 13 +++-- >

Re: [PATCH v2 0/3] Support opening a symlink with O_PATH | O_NOFOLLOW

2020-01-13 Thread Corinna Vinschen
Hi Ken, On Dec 29 17:56, Ken Brown wrote: > Currently, opening a symlink with O_NOFOLLOW fails with ELOOP. > Following Linux, the first patch in this series allows the call to > succeed if O_PATH is also specified. > > According to the Linux man page for 'open', the file descriptor > returned by