]> sigrok.org Git - libserialport.git/commitdiff
Set VMIN = 1, not zero which forces non-blocking reads.
authorMartin Ling <redacted>
Wed, 27 Nov 2013 01:16:51 +0000 (01:16 +0000)
committerMartin Ling <redacted>
Wed, 27 Nov 2013 01:37:35 +0000 (01:37 +0000)
serialport.c

index 7ee60db2b34c1590a1917be600ccba132c233c8c..6200083bcca3e1188bd841a3124fcd32b63de2a3 100644 (file)
@@ -34,6 +34,7 @@
 #include <tchar.h>
 #include <stdio.h>
 #else
+#include <limits.h>
 #include <termios.h>
 #include <sys/ioctl.h>
 #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. */