From 82f424e6cd5a911cfb1102f9d078436f9c0351c2 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Thu, 21 Nov 2013 17:22:16 +0000 Subject: [PATCH] Fix to sp_flush() on Unix. --- serialport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serialport.c b/serialport.c index 522cafa..35bb09b 100644 --- a/serialport.c +++ b/serialport.c @@ -525,7 +525,7 @@ enum sp_return sp_flush(struct sp_port *port, enum sp_buffer buffers) flags = TCIOFLUSH; else if (buffers & SP_BUF_INPUT) flags = TCIFLUSH; - if (buffers & SP_BUF_OUTPUT) + else if (buffers & SP_BUF_OUTPUT) flags = TCOFLUSH; /* Returns 0 upon success, -1 upon failure. */