Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Tue, 31 Dec 2002 10:01:31 +0000 From: "Steven O'Brien" To: gdb-patches AT sources DOT redhat DOT com Cc: cygwin AT cygwin DOT com Subject: [PATCH] fix broken tty command on cygwin Message-Id: <20021231100131.57a99df5.steven.obrien2@ntlworld.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi The gdb tty option and command is broken on cygwin. After setting a tty for the inferior, the first run seems OK, but the second sometimes fails and the third may cause gdb to hang or enter an infinite loop. The fix is to close the (redundant) tty fd *before* launching the inferior process instead of after. This fix is necessary to support anjuta and other gdb interfaces on cygwin. Changelog entry: 2002-12-31 Steven O'Brien * gdb/win32-nat.c (child_create_inferior): close tty fd before launching the inferior process. Patch: Index: win32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/win32-nat.c,v retrieving revision 1.66 diff -u -p -r1.66 win32-nat.c --- win32-nat.c 23 Nov 2002 02:49:45 -0000 1.66 +++ win32-nat.c 31 Dec 2002 09:47:00 -0000 @@ -1614,6 +1614,7 @@ child_create_inferior (char *exec_file, dup2 (tty, 0); dup2 (tty, 1); dup2 (tty, 2); + close (tty); } } @@ -1629,7 +1630,6 @@ child_create_inferior (char *exec_file, &pi); if (tty >= 0) { - close (tty); dup2 (ostdin, 0); dup2 (ostdout, 1); dup2 (ostderr, 2); -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/