From: Martin Ling Date: Sun, 21 Sep 2014 18:19:51 +0000 (+0100) Subject: tondaj-sl-814: Mark serial read call as nonblocking. X-Git-Tag: libsigrok-0.4.0~942 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=47d98603e706e8c4f2da2b031f31c6dd2cc3b246;p=libsigrok.git tondaj-sl-814: Mark serial read call as nonblocking. This call was already nonblocking since the driver opens the port with the SERIAL_NONBLOCK flag. Partial reads are handled. --- diff --git a/src/hardware/tondaj-sl-814/protocol.c b/src/hardware/tondaj-sl-814/protocol.c index feeec69a..b4deee13 100644 --- a/src/hardware/tondaj-sl-814/protocol.c +++ b/src/hardware/tondaj-sl-814/protocol.c @@ -167,7 +167,7 @@ int tondaj_sl_814_receive_data(int fd, int revents, void *cb_data) devc->state = GET_PACKET; } else if (devc->state == GET_PACKET) { /* Read a packet from the device. */ - ret = serial_read(serial, devc->buf + devc->buflen, + ret = serial_read_nonblocking(serial, devc->buf + devc->buflen, 4 - devc->buflen); if (ret < 0) { sr_err("Error reading packet: %d.", ret);