On Jan 10 22:37, Takashi Yano wrote:
> On Mon, 9 Jan 2023 10:25:33 +0100
> Corinna Vinschen wrote:
> > Also, given this was a "kludge" from 10 years ago, is it really still
> > needed?
>
> Ah, do you mean the "kludge":
> winsup/cygwin/syscalls.cc: 1455:
> /* This is a temporary kludge until all utilities can catch up
> with a change in behavior that implements linux functionality:
> opening a tty should not automatically cause it to become the
> controlling tty for the process. */
> if (!(flags & O_NOCTTY) && fd > 2 && myself->ctty != -2)
> {
> flags |= O_NOCTTY;
> /* flag that, if opened, this fhandler could later be capable
> of being a controlling terminal if /dev/tty is opened. */
> opt |= PC_CTTY;
> }
>
> and
>
> winsup/cygwin/dtable.cc: 767:
> /* This is a temporary kludge until all utilities can catch up with
> a change in behavior that implements linux functionality: opening
> a tty should not automatically cause it to become the controlling
> tty for the process. */
> if (newfd > 2)
> flags |= O_NOCTTY;
> ?
>
> These codes might be able to be deleted. I'll check if these
> are not needed.
Actually I meant commit c38a2d837303, introducing the -2 value for ctty.
But yeah, the above stuff is also interesting and every opportunity to
get rid of old workarounds is nice.
Corinna