Fixed a bug of uninitialized TERMIOS.
authorlace <>
Tue, 10 Jul 2007 21:50:51 +0000 (21:50 +0000)
committerlace <>
Tue, 10 Jul 2007 21:50:51 +0000 (21:50 +0000)
src/orphanripper.c

index cf3039f..7bea08d 100644 (file)
@@ -86,6 +86,13 @@ static int spawn (char **argv)
   assert (i == 0);
 
   /* With TERMP passed as NULL we get "\n" -> "\r\n".  */
+  termios.c_iflag = IGNBRK | IGNPAR;
+  termios.c_oflag = 0;
+  termios.c_cflag = CS8 | CREAD | CLOCAL | HUPCL | B9600;
+  termios.c_lflag = IEXTEN | NOFLSH;
+  memset (termios.c_cc, _POSIX_VDISABLE, sizeof (termios.c_cc));
+  termios.c_cc[VTIME] = 0;
+  termios.c_cc[VMIN ] = 1;
   cfmakeraw (&termios);
 #ifdef FLUSHO
   /* Workaround a readline deadlock bug in _get_tty_settings().  */