public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Cygwin: pty: Rename input named pipes.
@ 2021-03-21  3:59 Takashi Yano
  2021-03-22 11:49 ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Yano @ 2021-03-21  3:59 UTC (permalink / raw)
  To: cygwin-patches

- Currently, the name of input pipe is "ptyNNNN-from-master" for
  cygwin process, and "ptyNNNN-to-slave" for non-cygwin process.
  These are not only inconsistent with output pipes but also very
  confusing.
  With this patch, these are renamed to "ptyNNNN-from-master-cyg"
  and "ptyNNNN-from-master" respectively.
---
 winsup/cygwin/fhandler_tty.cc | 2 +-
 winsup/cygwin/tty.cc          | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 643a357ad..02e94efcc 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -2787,7 +2787,7 @@ fhandler_pty_master::setup ()
       goto err;
     }
 
-  __small_sprintf (pipename, "pty%d-to-slave", unit);
+  __small_sprintf (pipename, "pty%d-from-master", unit);
   /* FILE_FLAG_OVERLAPPED is specified here in order to prevent
      PeekNamedPipe() from blocking in transfer_input().
      Accordig to the official document, in order to access the handle
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc
index 3c016315c..269b87735 100644
--- a/winsup/cygwin/tty.cc
+++ b/winsup/cygwin/tty.cc
@@ -159,8 +159,8 @@ tty::not_allocated (HANDLE& r, HANDLE& w)
 {
   /* Attempt to open the from-master side of the tty.  If it is accessible
      then it exists although we may not have privileges to actually use it. */
-  char pipename[sizeof("ptyNNNN-from-master")];
-  __small_sprintf (pipename, "pty%d-from-master", get_minor ());
+  char pipename[sizeof("ptyNNNN-from-master-cyg")];
+  __small_sprintf (pipename, "pty%d-from-master-cyg", get_minor ());
   /* fhandler_pipe::create returns 0 when creation succeeds */
   return fhandler_pipe::create (&sec_none, &r, &w,
 				fhandler_pty_common::pipesize, pipename,
-- 
2.30.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Cygwin: pty: Rename input named pipes.
  2021-03-21  3:59 [PATCH] Cygwin: pty: Rename input named pipes Takashi Yano
@ 2021-03-22 11:49 ` Corinna Vinschen
  2021-03-23  0:38   ` Takashi Yano
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2021-03-22 11:49 UTC (permalink / raw)
  To: cygwin-patches

Hi Takashi,

On Mar 21 12:59, Takashi Yano via Cygwin-patches wrote:
> - Currently, the name of input pipe is "ptyNNNN-from-master" for
>   cygwin process, and "ptyNNNN-to-slave" for non-cygwin process.
>   These are not only inconsistent with output pipes but also very
>   confusing.
>   With this patch, these are renamed to "ptyNNNN-from-master-cyg"
>   and "ptyNNNN-from-master" respectively.
> ---
>  winsup/cygwin/fhandler_tty.cc | 2 +-
>  winsup/cygwin/tty.cc          | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

Actually... wouldn't it make more sense to call the Cygwin pipe

  pty%d-from-master / pty%d-to-slave

and the non-Cygwin one something like

  pty%d-from-master-nat / pty%d-to-slave-nat

?

After all, Cygwin is the norm, and non-Cygwin is the exception.

On second thought, this would also make sense for thr fhandler methods,
i. e.

  get_output_handle / get_output_handle_cyg

vs.

  get_output_handle_nat / get_output_handle

Probably the fhandler stuff is too much renaming for this release,
but we should do this for the next one, I think.


Thanks,
Corinna

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Cygwin: pty: Rename input named pipes.
  2021-03-22 11:49 ` Corinna Vinschen
@ 2021-03-23  0:38   ` Takashi Yano
  2021-03-23  9:32     ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Yano @ 2021-03-23  0:38 UTC (permalink / raw)
  To: cygwin-patches

On Mon, 22 Mar 2021 12:49:20 +0100
Corinna Vinschen wrote:
> Hi Takashi,
> 
> On Mar 21 12:59, Takashi Yano via Cygwin-patches wrote:
> > - Currently, the name of input pipe is "ptyNNNN-from-master" for
> >   cygwin process, and "ptyNNNN-to-slave" for non-cygwin process.
> >   These are not only inconsistent with output pipes but also very
> >   confusing.
> >   With this patch, these are renamed to "ptyNNNN-from-master-cyg"
> >   and "ptyNNNN-from-master" respectively.
> > ---
> >  winsup/cygwin/fhandler_tty.cc | 2 +-
> >  winsup/cygwin/tty.cc          | 4 ++--
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> Actually... wouldn't it make more sense to call the Cygwin pipe
> 
>   pty%d-from-master / pty%d-to-slave
> 
> and the non-Cygwin one something like
> 
>   pty%d-from-master-nat / pty%d-to-slave-nat
> 
> ?
> 
> After all, Cygwin is the norm, and non-Cygwin is the exception.
> 
> On second thought, this would also make sense for thr fhandler methods,
> i. e.
> 
>   get_output_handle / get_output_handle_cyg
> 
> vs.
> 
>   get_output_handle_nat / get_output_handle
> 
> Probably the fhandler stuff is too much renaming for this release,
> but we should do this for the next one, I think.

I basically agree. However, renaming them consistently is
too much for 3.2.0 release as you mentioned. So, IMHO, it
is better to apply this patch once for 3.2.0 release and
then fully rename them for the next one.

What do you think?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Cygwin: pty: Rename input named pipes.
  2021-03-23  0:38   ` Takashi Yano
@ 2021-03-23  9:32     ` Corinna Vinschen
  2021-03-23 11:49       ` Takashi Yano
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2021-03-23  9:32 UTC (permalink / raw)
  To: cygwin-patches

On Mar 23 09:38, Takashi Yano via Cygwin-patches wrote:
> On Mon, 22 Mar 2021 12:49:20 +0100
> Corinna Vinschen wrote:
> > Hi Takashi,
> > 
> > On Mar 21 12:59, Takashi Yano via Cygwin-patches wrote:
> > > - Currently, the name of input pipe is "ptyNNNN-from-master" for
> > >   cygwin process, and "ptyNNNN-to-slave" for non-cygwin process.
> > >   These are not only inconsistent with output pipes but also very
> > >   confusing.
> > >   With this patch, these are renamed to "ptyNNNN-from-master-cyg"
> > >   and "ptyNNNN-from-master" respectively.
> > > ---
> > >  winsup/cygwin/fhandler_tty.cc | 2 +-
> > >  winsup/cygwin/tty.cc          | 4 ++--
> > >  2 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > Actually... wouldn't it make more sense to call the Cygwin pipe
> > 
> >   pty%d-from-master / pty%d-to-slave
> > 
> > and the non-Cygwin one something like
> > 
> >   pty%d-from-master-nat / pty%d-to-slave-nat
> > 
> > ?
> > 
> > After all, Cygwin is the norm, and non-Cygwin is the exception.
> > 
> > On second thought, this would also make sense for thr fhandler methods,
> > i. e.
> > 
> >   get_output_handle / get_output_handle_cyg
> > 
> > vs.
> > 
> >   get_output_handle_nat / get_output_handle
> > 
> > Probably the fhandler stuff is too much renaming for this release,
> > but we should do this for the next one, I think.
> 
> I basically agree. However, renaming them consistently is
> too much for 3.2.0 release as you mentioned. So, IMHO, it
> is better to apply this patch once for 3.2.0 release and
> then fully rename them for the next one.
> 
> What do you think?

I thought of renaming the pipes in this release, since you're already
renaimg it anyway.  Renaming the fhandler members and methods could
take place in the next release.

Do you prefer to rename pipes and fhandler methods in a single release?


Thanks,
Corinna

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Cygwin: pty: Rename input named pipes.
  2021-03-23  9:32     ` Corinna Vinschen
@ 2021-03-23 11:49       ` Takashi Yano
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Yano @ 2021-03-23 11:49 UTC (permalink / raw)
  To: cygwin-patches

On Tue, 23 Mar 2021 10:32:34 +0100
Corinna Vinschen wrote:
> On Mar 23 09:38, Takashi Yano via Cygwin-patches wrote:
> > On Mon, 22 Mar 2021 12:49:20 +0100
> > Corinna Vinschen wrote:
> > > Hi Takashi,
> > > 
> > > On Mar 21 12:59, Takashi Yano via Cygwin-patches wrote:
> > > > - Currently, the name of input pipe is "ptyNNNN-from-master" for
> > > >   cygwin process, and "ptyNNNN-to-slave" for non-cygwin process.
> > > >   These are not only inconsistent with output pipes but also very
> > > >   confusing.
> > > >   With this patch, these are renamed to "ptyNNNN-from-master-cyg"
> > > >   and "ptyNNNN-from-master" respectively.
> > > > ---
> > > >  winsup/cygwin/fhandler_tty.cc | 2 +-
> > > >  winsup/cygwin/tty.cc          | 4 ++--
> > > >  2 files changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > Actually... wouldn't it make more sense to call the Cygwin pipe
> > > 
> > >   pty%d-from-master / pty%d-to-slave
> > > 
> > > and the non-Cygwin one something like
> > > 
> > >   pty%d-from-master-nat / pty%d-to-slave-nat
> > > 
> > > ?
> > > 
> > > After all, Cygwin is the norm, and non-Cygwin is the exception.
> > > 
> > > On second thought, this would also make sense for thr fhandler methods,
> > > i. e.
> > > 
> > >   get_output_handle / get_output_handle_cyg
> > > 
> > > vs.
> > > 
> > >   get_output_handle_nat / get_output_handle
> > > 
> > > Probably the fhandler stuff is too much renaming for this release,
> > > but we should do this for the next one, I think.
> > 
> > I basically agree. However, renaming them consistently is
> > too much for 3.2.0 release as you mentioned. So, IMHO, it
> > is better to apply this patch once for 3.2.0 release and
> > then fully rename them for the next one.
> > 
> > What do you think?
> 
> I thought of renaming the pipes in this release, since you're already
> renaimg it anyway.  Renaming the fhandler members and methods could
> take place in the next release.

OK. I will submit the rename patch.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-23 11:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-21  3:59 [PATCH] Cygwin: pty: Rename input named pipes Takashi Yano
2021-03-22 11:49 ` Corinna Vinschen
2021-03-23  0:38   ` Takashi Yano
2021-03-23  9:32     ` Corinna Vinschen
2021-03-23 11:49       ` Takashi Yano

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).