X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fcommon%2Fserial.c;h=b7ec2da3fe7d491ab946eb45b5a12d1e7cc00103;hb=d3b38ad389a6186e2822d62b20b9f0d9d9e7c21c;hp=4ac342f06d9b6e63273a34ecdfa4aa4bf3279bac;hpb=86c02e6554061bf84b5fb7893e5837d26534a6d8;p=libsigrok.git diff --git a/hardware/common/serial.c b/hardware/common/serial.c index 4ac342f0..b7ec2da3 100644 --- a/hardware/common/serial.c +++ b/hardware/common/serial.c @@ -589,8 +589,12 @@ SR_PRIV int serial_set_params(struct sr_serial_dev_inst *serial, int baudrate, return SR_ERR; } - /* Do not translate carriage return to newline on input. */ - term.c_iflag &= ~(ICRNL); + /* Turn off all serial port cooking. */ + term.c_iflag &= ~(ISTRIP | INLCR | ICRNL); + term.c_oflag &= ~(ONLCR | OCRNL | ONOCR); +#if !defined(__NetBSD__) + term.c_oflag &= ~OFILL; +#endif /* Disable canonical mode, and don't echo input characters. */ term.c_lflag &= ~(ICANON | ECHO);