Workaround a readline deadlock bug in _get_tty_settings().
authorlace <>
Tue, 10 Jul 2007 21:43:43 +0000 (21:43 +0000)
committerlace <>
Tue, 10 Jul 2007 21:43:43 +0000 (21:43 +0000)
src/orphanripper.c

index 0615aa4..cf3039f 100644 (file)
@@ -87,6 +87,10 @@ static int spawn (char **argv)
 
   /* With TERMP passed as NULL we get "\n" -> "\r\n".  */
   cfmakeraw (&termios);
+#ifdef FLUSHO
+  /* Workaround a readline deadlock bug in _get_tty_settings().  */
+  termios.c_lflag &= ~FLUSHO;
+#endif
   child = forkpty (&amaster, childptyname, &termios, NULL);
   switch (child)
     {
@@ -98,6 +102,15 @@ static int spawn (char **argv)
        assert (i == 0);
        i = close (pipefd[1]);
        assert (i == 0);
+
+       /* Do not replace STDIN as inferiors query its termios.  */
+#if 0
+       i = close (STDIN_FILENO);
+       assert (i == 0);
+       i = open ("/dev/null", O_RDONLY);
+       assert (i == STDIN_FILENO);
+#endif
+
        /* Do not setpgrp(2) in the parent process as the process-group
           is shared for the whole sh(1) pipeline we could be a part
           of.  The process-group is set according to PID of the first