From: Martin Ling Date: Tue, 16 Sep 2014 00:58:54 +0000 (+0100) Subject: serial-dmm: Mark serial read/write calls as nonblocking. X-Git-Tag: libsigrok-0.4.0~982 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4277ac349ced6224e8093fea79b6988315fbb780;p=libsigrok.git serial-dmm: Mark serial read/write calls as nonblocking. This driver opens the port with the SERIAL_NONBLOCK flag so these calls were already non-blocking. --- diff --git a/src/dmm/metex14.c b/src/dmm/metex14.c index 8151aa9d..5db28cb9 100644 --- a/src/dmm/metex14.c +++ b/src/dmm/metex14.c @@ -283,7 +283,7 @@ SR_PRIV int sr_metex14_packet_request(struct sr_serial_dev_inst *serial) sr_spew("Requesting DMM packet."); - return (serial_write(serial, &wbuf, 1) == 1) ? SR_OK : SR_ERR; + return (serial_write_nonblocking(serial, &wbuf, 1) == 1) ? SR_OK : SR_ERR; } #endif diff --git a/src/hardware/serial-dmm/protocol.c b/src/hardware/serial-dmm/protocol.c index c8127939..e667ca49 100644 --- a/src/hardware/serial-dmm/protocol.c +++ b/src/hardware/serial-dmm/protocol.c @@ -110,7 +110,7 @@ static void handle_new_data(struct sr_dev_inst *sdi, int dmm, void *info) /* Try to get as much data as the buffer can hold. */ len = DMM_BUFSIZE - devc->buflen; - len = serial_read(serial, devc->buf + devc->buflen, len); + len = serial_read_nonblocking(serial, devc->buf + devc->buflen, len); if (len == 0) return; /* No new bytes, nothing to do. */ if (len < 0) {