From: Martin Ling Date: Thu, 21 Nov 2013 17:22:16 +0000 (+0000) Subject: Fix to sp_flush() on Unix. X-Git-Tag: libserialport-0.1.0~80 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=82f424e6cd5a911cfb1102f9d078436f9c0351c2;p=libserialport.git Fix to sp_flush() on Unix. --- 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. */