changeset 104723:1eb83f01c48d

(wait_reading_process_output): Keep the descriptor when pty is used by a non-child process, e.g., in I/O buffer of GDB this allows inferior to be restarted.
author Nick Roberts <nickrob@snap.net.nz>
date Sun, 30 Aug 2009 04:54:34 +0000
parents cd2c56c4b098
children 8bd22a0db033
files src/process.c
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Sun Aug 30 04:50:49 2009 +0000
+++ b/src/process.c	Sun Aug 30 04:54:34 2009 +0000
@@ -5150,11 +5150,16 @@
 		 It can't hurt.  */
 	      else if (nread == -1 && errno == EIO)
 		{
-		  /* Clear the descriptor now, so we only raise the signal once.  */
-		  FD_CLR (channel, &input_wait_mask);
-		  FD_CLR (channel, &non_keyboard_wait_mask);
-
-		  kill (getpid (), SIGCHLD);
+		  /* Clear the descriptor now, so we only raise the
+		     signal once.  Don't do this is `process' is only
+		     a pty.  */
+		  if (XPROCESS (proc)->pid != -2)
+		    {
+		      FD_CLR (channel, &input_wait_mask);
+		      FD_CLR (channel, &non_keyboard_wait_mask);
+
+		      kill (getpid (), SIGCHLD);
+		    }
 		}
 #endif /* HAVE_PTYS */
 	      /* If we can detect process termination, don't consider the process