From: Martin Ling Date: Wed, 27 Nov 2013 01:16:51 +0000 (+0000) Subject: Set VMIN = 1, not zero which forces non-blocking reads. X-Git-Tag: libserialport-0.1.0~39 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8fbf876dfd7dba622c1150cd886a30357374c5f4;p=libserialport.git Set VMIN = 1, not zero which forces non-blocking reads. --- diff --git a/serialport.c b/serialport.c index 7ee60db..6200083 100644 --- a/serialport.c +++ b/serialport.c @@ -34,6 +34,7 @@ #include #include #else +#include #include #include #endif @@ -700,7 +701,7 @@ enum sp_return sp_open(struct sp_port *port, enum sp_mode flags) data.term.c_oflag &= ~OFILL; #endif data.term.c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN); - data.term.c_cc[VMIN] = 0; + data.term.c_cc[VMIN] = 1; data.term.c_cc[VTIME] = 0; /* Ignore modem status lines; enable receiver; leave control lines alone on close. */