]> sigrok.org Git - libserialport.git/commitdiff
Fix to sp_flush() on Unix.
authorMartin Ling <redacted>
Thu, 21 Nov 2013 17:22:16 +0000 (17:22 +0000)
committerBert Vermeulen <redacted>
Fri, 22 Nov 2013 01:19:12 +0000 (02:19 +0100)
serialport.c

index 522cafa5e014eebb705bce00da23653a31232d44..35bb09b9e6a3316d0d3161b836670ae9fa831e5c 100644 (file)
@@ -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. */