Fix the sp_flush() so that it flushes only the requested buffers
also in unix.
---
serialport.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/serialport.c b/serialport.c
index d437140..4f42740 100644
--- a/serialport.c
+++ b/serialport.c
@@ -618,11 +618,11 @@ SP_API enum sp_return sp_flush(struct sp_port *port, enum
sp_buffer buffers)
RETURN_FAIL("PurgeComm() failed");
#else
int flags = 0;
- if (buffers & SP_BUF_BOTH)
+ if (buffers == SP_BUF_BOTH)
flags = TCIOFLUSH;
- else if (buffers & SP_BUF_INPUT)
+ else if (buffers == SP_BUF_INPUT)
flags = TCIFLUSH;
- else if (buffers & SP_BUF_OUTPUT)
+ else if (buffers == SP_BUF_OUTPUT)
flags = TCOFLUSH;
/* Returns 0 upon success, -1 upon failure. */
--
2.1.0
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel