X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/e26f8aa1a74344b91737741ecef89a10de0fa241..733a5f4b3083f389ca13acdbf22cd3fe4726bd8d:/unix/uxser.c diff --git a/unix/uxser.c b/unix/uxser.c index 463f4c43..454d7b36 100644 --- a/unix/uxser.c +++ b/unix/uxser.c @@ -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; @@ -248,6 +257,8 @@ static const char *serial_init(void *frontend_handle, void **backend_handle, if (serial->fd < 0) return "Unable to open serial port"; + cloexec(serial->fd); + err = serial_configure(serial, cfg); if (err) return err;