]> sigrok.org Git - libsigrok.git/commitdiff
ols: Always open serial port in nonblocking mode.
authorUwe Hermann <redacted>
Tue, 19 Nov 2013 22:22:46 +0000 (23:22 +0100)
committerUwe Hermann <redacted>
Tue, 19 Nov 2013 22:22:46 +0000 (23:22 +0100)
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.

hardware/openbench-logic-sniffer/api.c

index 8a83abc711447843bf432964edf26ca3cd391fae..0d76a7fccb5561b56591cd0196567b2393b91810 100644 (file)
@@ -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;