From: Martin Ling Date: Sun, 21 Sep 2014 17:12:48 +0000 (+0100) Subject: fluke-dmm: Mark serial read call as nonblocking. X-Git-Tag: libsigrok-0.4.0~962 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=707fa85ad5fa7e3f74dbb6863891e80a26126b25;hp=55e32714f994aaf4841b59bc67c82d263aeb0a70;p=libsigrok.git fluke-dmm: Mark serial read call as nonblocking. This call was already nonblocking since the driver opens the port with the SERIAL_NONBLOCK flag. Only one byte is read. The case of 0 being returned is not handled, but the call is only made if G_IO_IN occurred so in theory, there should be a byte available. It might be wise to add handling for a return of 0 nonetheless, as I'm not sure if this is always accurate. --- diff --git a/src/hardware/fluke-dmm/fluke.c b/src/hardware/fluke-dmm/fluke.c index edb6734a..242843df 100644 --- a/src/hardware/fluke-dmm/fluke.c +++ b/src/hardware/fluke-dmm/fluke.c @@ -501,7 +501,7 @@ SR_PRIV int fluke_receive_data(int fd, int revents, void *cb_data) if (revents == G_IO_IN) { /* Serial data arrived. */ while(FLUKEDMM_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++;