public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: pinfo: Additional fix for CTTY behavior.
Date: Tue, 10 Jan 2023 15:35:35 +0100	[thread overview]
Message-ID: <Y713t43ryah6qmHw@calimero.vinschen.de> (raw)
In-Reply-To: <20230110223706.1d38233b6be7d03f512275dc@nifty.ne.jp>

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

      reply	other threads:[~2023-01-10 14:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28  8:35 Takashi Yano
2023-01-09  9:25 ` Corinna Vinschen
2023-01-10  9:52   ` Takashi Yano
2023-01-10 10:35     ` Corinna Vinschen
2023-01-10 13:37   ` Takashi Yano
2023-01-10 14:35     ` Corinna Vinschen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y713t43ryah6qmHw@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).