On Jul 24 15:13, Corinna Vinschen wrote: > On Jul 24 15:06, Corinna Vinschen wrote: > > On Jul 24 20:57, Takashi Yano wrote: > > > Previously, process_fd failed to correctly handle fhandlers using an > > > archetype. This was due to the missing PATH_OPEN flag in path_conv, > > > which caused build_fh_pc() to skip archetype initialization. The > > > root cause was a bug where open() did not set the PATH_OPEN flag > > > for fhandlers using an archetype. > > > > > > This patch introduces a new method, path_conv::set_isopen(), to > > > explicitly set the PATH_OPEN flag in path_flags in fhandler_base:: > > > open_with_arch(). > > > > Wouldn't this patch fix the problem as well? > > > > diff --git a/winsup/cygwin/fhandler/console.cc > > b/winsup/cygwin/fhandler/console.cc > > index 887e2ef722bf..2801c806edd5 100644 > > --- a/winsup/cygwin/fhandler/console.cc > > +++ b/winsup/cygwin/fhandler/console.cc > > @@ -4311,7 +4311,7 @@ fhandler_console::init (HANDLE h, DWORD a, mode_t > > bin, int64_t dummy) > > { > > // this->fhandler_termios::init (h, mode, bin); > > /* Ensure both input and output console handles are open */ > > - int flags = 0; > > + int flags = PC_OPEN; > > > > a &= GENERIC_READ | GENERIC_WRITE; > > if (a == GENERIC_READ) > > diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc > > index 77a363eb0e3b..10785e240091 100644 > > --- a/winsup/cygwin/fhandler/pty.cc > > +++ b/winsup/cygwin/fhandler/pty.cc > > @@ -1015,7 +1015,7 @@ fhandler_pty_slave::close (int flag) > > int > > fhandler_pty_slave::init (HANDLE h, DWORD a, mode_t, int64_t dummy) > > { > > - int flags = 0; > > + int flags = PC_OPEN; > > > > a &= GENERIC_READ | GENERIC_WRITE; > > if (a == GENERIC_READ) > > > > > > Corinna > > No, it wouldn't. flags are not or'ed in the followup code. Sigh. > > diff --git a/winsup/cygwin/fhandler/console.cc > b/winsup/cygwin/fhandler/console.cc
And no, this one wouldn't either. I'm not thinking straight ATM, sorry. Your patch is GTG. Thanks, Corinna