delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/12/31/05:00:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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" <steven DOT obrien2 AT ntlworld DOT com>
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

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  <steven DOT obrien2 AT ntlworld DOT com>

	* 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019