From: Martin Ling Date: Sun, 21 Sep 2014 18:17:02 +0000 (+0100) Subject: teleinfo: Mark serial read as nonblocking, remove SERIAL_NONBLOCK flag. X-Git-Tag: libsigrok-0.4.0~943 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=9333691aaf1b08f597caa6a6490ebb56441f4a38;p=libsigrok.git teleinfo: Mark serial read as nonblocking, remove SERIAL_NONBLOCK flag. This call was already nonblocking due to the flag. --- diff --git a/src/hardware/teleinfo/api.c b/src/hardware/teleinfo/api.c index 4060b03e..77cd5f8d 100644 --- a/src/hardware/teleinfo/api.c +++ b/src/hardware/teleinfo/api.c @@ -76,7 +76,7 @@ static GSList *scan(GSList *options) if (!(serial = sr_serial_dev_inst_new(conn, serialcomm))) return NULL; - if (serial_open(serial, SERIAL_RDONLY | SERIAL_NONBLOCK) != SR_OK) + if (serial_open(serial, SERIAL_RDONLY) != SR_OK) return NULL; sr_info("Probing serial port %s.", conn); diff --git a/src/hardware/teleinfo/protocol.c b/src/hardware/teleinfo/protocol.c index a610173d..d2b96e1f 100644 --- a/src/hardware/teleinfo/protocol.c +++ b/src/hardware/teleinfo/protocol.c @@ -196,7 +196,7 @@ SR_PRIV int teleinfo_receive_data(int fd, int revents, void *cb_data) /* Try to get as much data as the buffer can hold. */ len = TELEINFO_BUF_SIZE - devc->buf_len; - len = serial_read(serial, devc->buf + devc->buf_len, len); + len = serial_read_nonblocking(serial, devc->buf + devc->buf_len, len); if (len < 1) { sr_err("Serial port read error: %d.", len); return FALSE;