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: Mon, 9 Jan 2023 10:25:33 +0100	[thread overview]
Message-ID: <Y7vdjTREYWiLAJ9N@calimero.vinschen.de> (raw)
In-Reply-To: <20221228083516.1226-1-takashi.yano@nifty.ne.jp>

Hi Takashi,

On Dec 28 17:35, Takashi Yano wrote:
> The commit 25c4ad6ea52f did not fix the CTTY behavior enough. For
> example, in the following test case, TTY will be associated as
> a CTTY on the second open() call even though the TTY is already
> CTTY of another session. This patch fixes the issue.

The patch is ok, thanks.

But while looking into this patch, I realized how confusing the old code
is.  An unsuspecting reader will have a really hard time to figure out
what ctty values of -1 or -2 actually mean.  The CVS log entry from 2012
isn't enlightening either:

  On second thought, in the spirit of keeping things kludgy, set ctty to
  -2 here as a special flag ...

Would you mind to introduce speaking symbolic values for them and add
some comments to make them more transparent?

Also, given this was a "kludge" from 10 years ago, is it really still
needed?

As I said, it's confusing :}


Thanks,
Corinna

  reply	other threads:[~2023-01-09  9:25 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 [this message]
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

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