X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxser.c;h=a12fdec76add7098a3e8b622a3845e1bc9200d9a;hb=46c00b0f381f48a9992e43e014e104015952e9da;hp=08f2157544a3ba7e27eebfd5a570ae334a8adebd;hpb=fd6d9bd677cbb2a1a56060d118f4d56b61c82244;p=PuTTY.git diff --git a/unix/uxser.c b/unix/uxser.c index 08f21575..a12fdec7 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, + "serial", + PROT_SERIAL, 1 };