From: Martin Ling Date: Sun, 21 Sep 2014 20:26:36 +0000 (+0100) Subject: serial_stream_detect: Make read nonblocking. X-Git-Tag: libsigrok-0.4.0~986 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=18e4d5bc45ec5571270040df5433fd7f6b79e03e;p=libsigrok.git serial_stream_detect: Make read nonblocking. This code implements its own waiting based on baudrate, so the read itself should be nonblocking. In general it will have been already, since drivers almost universally use the SERIAL_NONBLOCK flag. --- diff --git a/src/serial.c b/src/serial.c index 705c52df..4943bb10 100644 --- a/src/serial.c +++ b/src/serial.c @@ -618,7 +618,7 @@ SR_PRIV int serial_stream_detect(struct sr_serial_dev_inst *serial, i = ibuf = len = 0; while (ibuf < maxlen) { - len = serial_read(serial, &buf[ibuf], 1); + len = serial_read_nonblocking(serial, &buf[ibuf], 1); if (len > 0) { ibuf += len; } else if (len == 0) {