Disable a bunch of undesirable termios flags. ICRNL, in particular,
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 3 Oct 2006 17:16:26 +0000 (17:16 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 3 Oct 2006 17:16:26 +0000 (17:16 +0000)
is liable to have been set on serial ports previously used as
terminal devices, and definitely wants not to be set on serial ports
being used for callout.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6865 cda61777-01e9-0310-a592-d414129be87e

unix/uxser.c

index 463f4c4..d647108 100644 (file)
@@ -205,7 +205,16 @@ static const char *serial_configure(Serial serial, Config *cfg)
 
     options.c_cflag |= CLOCAL | CREAD;
     options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
-    options.c_oflag &= ~OPOST;
+    options.c_iflag &= ~(ISTRIP | IGNCR | INLCR | ICRNL
+#ifdef IUCLC
+                        | IUCLC
+#endif
+                        );
+    options.c_oflag &= ~(OPOST
+#ifdef ONLCR
+                        | ONLCR
+#endif
+                        | OCRNL | ONOCR | ONLRET);
     options.c_cc[VMIN] = 1;
     options.c_cc[VTIME] = 0;