X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/89e97516fedf1d0a7fe9c569bb569fa7ea872afa..16707d1c7eb2a7e182b5ed1f4b1f38f746a73b1a:/unix/uxser.c diff --git a/unix/uxser.c b/unix/uxser.c index 08f21575..92961a7d 100644 --- a/unix/uxser.c +++ b/unix/uxser.c @@ -214,7 +214,16 @@ static const char *serial_configure(Serial serial, Config *cfg) #ifdef ONLCR | ONLCR #endif - | OCRNL | ONOCR | ONLRET); +#ifdef OCRNL + | OCRNL +#endif +#ifdef ONOCR + | ONOCR +#endif +#ifdef ONLRET + | ONLRET +#endif + ); options.c_cc[VMIN] = 1; options.c_cc[VTIME] = 0; @@ -257,7 +266,7 @@ static const char *serial_init(void *frontend_handle, void **backend_handle, if (serial->fd < 0) return "Unable to open serial port"; - fcntl(serial->fd, F_SETFD, FD_CLOEXEC); + cloexec(serial->fd); err = serial_configure(serial, cfg); if (err) @@ -527,5 +536,7 @@ Backend serial_backend = { serial_provide_logctx, serial_unthrottle, serial_cfg_info, - 1 + "serial", + PROT_SERIAL, + 0 };