From: Uwe Hermann Date: Tue, 19 Nov 2013 22:22:46 +0000 (+0100) Subject: ols: Always open serial port in nonblocking mode. X-Git-Tag: libsigrok-0.3.0~549 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4403c39fe4c681352d1bac7efc1725f4eecb6215;p=libsigrok.git ols: Always open serial port in nonblocking mode. The scan() function was opening the port in non-blocking mode, the dev_open() function however was not using the SERIAL_NONBLOCK flag. This led to hangs in certain situations. This fixes the OLS e.g. on NetBSD. --- diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 8a83abc7..0d76a7fc 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -209,7 +209,7 @@ static int dev_open(struct sr_dev_inst *sdi) struct sr_serial_dev_inst *serial; serial = sdi->conn; - if (serial_open(serial, SERIAL_RDWR) != SR_OK) + if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) return SR_ERR; sdi->status = SR_ST_ACTIVE;