]> sigrok.org Git - libsigrok.git/commitdiff
motech-lps-30x: Mark serial read call as nonblocking.
authorMartin Ling <redacted>
Sun, 21 Sep 2014 17:59:45 +0000 (18:59 +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. It only reads one byte, and a zero result is handled
appropriately.

src/hardware/motech-lps-30x/protocol.c

index c4afd657a730becdc1a26ede17917b35a193b9a5..78d822f0ba21fd8724511d860efebb05d7ce1262 100644 (file)
@@ -152,7 +152,7 @@ SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
 
        if (revents == G_IO_IN) { /* Serial data arrived. */
                while (LINELEN_MAX - devc->buflen - 2 > 0) {
-                       len = serial_read(serial, devc->buf + devc->buflen, 1);
+                       len = serial_read_nonblocking(serial, devc->buf + devc->buflen, 1);
                        if (len < 1)
                                break;