]> sigrok.org Git - libsigrok.git/commitdiff
norma-dmm: Mark serial read call as nonblocking.
authorMartin Ling <redacted>
Sun, 21 Sep 2014 18:11:23 +0000 (19:11 +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/norma-dmm/protocol.c

index 717ef15213142ed93080578aa4599ae7e4a1ef1b..522d88a1749451c62fc1f0d9f527e656e1f7eaa5 100644 (file)
@@ -391,7 +391,7 @@ SR_PRIV int norma_dmm_receive_data(int fd, int revents, void *cb_data)
        if (revents == G_IO_IN) {
                /* Serial data arrived. */
                while (NMADMM_BUFSIZE - devc->buflen - 1 > 0) {
-                       len = serial_read(serial, devc->buf + devc->buflen, 1);
+                       len = serial_read_nonblocking(serial, devc->buf + devc->buflen, 1);
                        if (len < 1)
                                break;
                        devc->buflen += len;