From: Alexandru Gagniuc Date: Sun, 2 Dec 2012 18:43:37 +0000 (-0600) Subject: radioshack-dmm: Fix opening of serial port. X-Git-Tag: dsupstream~492 X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;h=ae95ffebfa0d8c0992332b33631a26d898957b34;p=libsigrok.git radioshack-dmm: Fix opening of serial port. During scan the serial port is opened with SERIAL_RDONLY | SERIAL_NONBLOCK, which works fine, but when acquisition starts, it is opened only with SERIAL_RDONLY. On Linux, if cdc_acm can make a claim to the USB to serial converter, opening the port will fail. Open port with SERIAL_RDONLY | SERIAL_NONBLOCK. Signed-off-by: Alexandru Gagniuc --- diff --git a/hardware/radioshack-dmm/api.c b/hardware/radioshack-dmm/api.c index 47620e3c..789685dd 100644 --- a/hardware/radioshack-dmm/api.c +++ b/hardware/radioshack-dmm/api.c @@ -217,7 +217,7 @@ static int hw_dev_open(struct sr_dev_inst *sdi) return SR_ERR_BUG; } - if (serial_open(devc->serial, SERIAL_RDONLY) != SR_OK) + if (serial_open(devc->serial, SERIAL_RDONLY | SERIAL_NONBLOCK) != SR_OK) return SR_ERR; sdi->status = SR_ST_ACTIVE;