]> sigrok.org Git - libsigrok.git/commitdiff
tondaj-sl-814: Mark serial read call as nonblocking.
authorMartin Ling <redacted>
Sun, 21 Sep 2014 18:19:51 +0000 (19:19 +0100)
committerUwe Hermann <redacted>
Wed, 24 Sep 2014 21:30:31 +0000 (23:30 +0200)
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. Partial reads are handled.

src/hardware/tondaj-sl-814/protocol.c

index feeec69aa559c7f947eacc111952aa991cc9aa2e..b4deee1364f5b6fafdec8eeef16ee1a3de687927 100644 (file)
@@ -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);