public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: pty: Fix state mismatch caused in octave gui.
@ 2020-01-17  9:21 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2020-01-17  9:21 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7e6c96d6e1485b52b4243d0cd9699f2063645660

commit 7e6c96d6e1485b52b4243d0cd9699f2063645660
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Thu Jan 16 20:04:47 2020 +0900

    Cygwin: pty: Fix state mismatch caused in octave gui.
    
    - In octave gui, sometimes state mismatch between real pty state
      and state variable occurs. For example, this occurs when 'ls'
      command is executed in octave gui. This patch fixes the issue.

Diff:
---
 winsup/cygwin/spawn.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 08d52bb..f7c6dd5 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -947,6 +947,15 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
     {
       FreeConsole ();
       AttachConsole (pid_restore);
+      cygheap_fdenum cfd (false);
+      int fd;
+      while ((fd = cfd.next ()) >= 0)
+	if (cfd->get_major () == DEV_PTYS_MAJOR)
+	  {
+	    fhandler_pty_slave *ptys =
+	      (fhandler_pty_slave *) (fhandler_base *) cfd;
+	    ptys->fixup_after_attach (false, fd);
+	  }
     }
 
   return (int) res;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-17  9:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17  9:21 [newlib-cygwin] Cygwin: pty: Fix state mismatch caused in octave gui Corinna Vinschen

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