Fix the sp_flush() so that it flushes only the requested buffers
also in unix.
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. */