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: dtable: Delete old kludge code for /dev/tty.
Date: Mon, 3 Jul 2023 12:52:25 +0200	[thread overview]
Message-ID: <ZKKoaQlqEXjBjNV7@calimero.vinschen.de> (raw)
In-Reply-To: <20230627132826.9321-1-takashi.yano@nifty.ne.jp>

Hi Takashi,

On Jun 27 22:28, Takashi Yano wrote:
> This old kludge code assigns fhandler_console for /dev/tty even
> if the CTTY is not a console when stat() has been called. Due to
> this, the problem reported in
> https://cygwin.com/pipermail/cygwin/2023-June/253888.html
> occurs after the commit 3721a756b0d8 ("Cygwin: console: Make the
> console accessible from other terminals.").
> 
> This patch fixes the issue by dropping the old kludge code.
> 
> Reported-by: Bruce Jerrick <bmj001@gmail.com>
> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>

Please add a "Fixes:" tag line.

> ---
>  winsup/cygwin/dtable.cc | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
> index 18e0f3097..9427e238e 100644
> --- a/winsup/cygwin/dtable.cc
> +++ b/winsup/cygwin/dtable.cc
> @@ -598,12 +598,7 @@ fh_alloc (path_conv& pc)
>  	  fh = cnew (fhandler_mqueue);
>  	  break;
>  	case FH_TTY:
> -	  if (!pc.isopen ())
> -	    {
> -	      fhraw = cnew_no_ctor (fhandler_console, -1);
> -	      debug_printf ("not called from open for /dev/tty");
> -	    }

This is ok-ish.  The problem is that the original patch 23771fa1f7028
does not explain *why* it assigned a console fhandler if the file is not
open.  Given that, it's not clear what side-effects we might encounter
if we change this.  Do you understand the situation here can you explain
why dropping this kludge will do the right thing now?  If so, it would
be great to have a good description of the original idea behind the
code and why we don't need it anymore in the commit message.


Thanks,
Corinna

  reply	other threads:[~2023-07-03 10:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27 13:28 Takashi Yano
2023-07-03 10:52 ` Corinna Vinschen [this message]
2023-07-04  9:58   ` Takashi Yano
2023-07-04 15:59     ` Johannes Schindelin
2023-07-07  3:30       ` Takashi Yano

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=ZKKoaQlqEXjBjNV7@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).