From: Martin Ling Date: Fri, 27 Mar 2015 22:43:14 +0000 (+0000) Subject: windows: Set fAbortOnError=FALSE. X-Git-Tag: libserialport-0.1.1~75 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=34442106efcf0621f5bc2f77aab771407d9ae5c2;p=libserialport.git windows: Set fAbortOnError=FALSE. Since we're not handling and clearing receive errors (framing, parity and overrun), we should turn them off to avoid crashing out with ERROR_OPERATION_ABORTED in various calls if they occur. Invalid data will then simply not end up in the buffer. This is consistent with our current behaviour on posix/termios systems. It might be nice to be able to inform calling code about receive errors, but I can't see a good way to do this in a cross-platform way at the moment. This fixes (parts of) bug #341. --- diff --git a/serialport.c b/serialport.c index a9b88e6..f5859e2 100644 --- a/serialport.c +++ b/serialport.c @@ -546,7 +546,7 @@ SP_API enum sp_return sp_open(struct sp_port *port, enum sp_mode flags) data.dcb.fDsrSensitivity = FALSE; data.dcb.fErrorChar = FALSE; data.dcb.fNull = FALSE; - data.dcb.fAbortOnError = TRUE; + data.dcb.fAbortOnError = FALSE; #else /* Turn off all fancy termios tricks, give us a raw channel. */ data.term.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IMAXBEL);