Flush only the requested buffers
Fix the sp_flush() so that it flushes only the requested buffers also in unix.
This commit is contained in:
parent
d66bbceaa7
commit
ad7498553c
|
@ -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. */
|
||||
|
|
Loading…
Reference in New Issue