]> sigrok.org Git - libsigrok.git/commitdiff
gmc-mh-1x-2x: Mark serial read call as nonblocking.
authorMartin Ling <redacted>
Sun, 21 Sep 2014 17:33:34 +0000 (18:33 +0100)
committerUwe Hermann <redacted>
Wed, 24 Sep 2014 21:30:30 +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/gmc-mh-1x-2x/api.c

index 4574dfea72d7d8f79d3db665713b82e2ebd4aa2f..1a969d113500a0acea76955a4bf3a9bd641735ee 100644 (file)
@@ -90,7 +90,7 @@ static int read_byte(struct sr_serial_dev_inst *serial, gint64 timeout)
        int rc = 0;
 
        for (;;) {
-               rc = serial_read(serial, &result, 1);
+               rc = serial_read_nonblocking(serial, &result, 1);
                if (rc == 1) {
                        sr_spew("read: 0x%02x/%d", result, result);
                        return result;