From 4403c39fe4c681352d1bac7efc1725f4eecb6215 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Tue, 19 Nov 2013 23:22:46 +0100 Subject: [PATCH] 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. --- hardware/openbench-logic-sniffer/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;