Skip to content

Commit 2dbf9a9

Browse files
committed
Ref #46 - altered flush() for posx to use tcdrain rather than tcflush
1 parent d1f900d commit 2dbf9a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/serial/private/serialport/serialport_posix.nim

+1-1
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ proc flush*(port: SerialPort | AsyncSerialPort) =
834834
if not port.isOpen():
835835
raise newException(InvalidSerialPortStateError, "Port must be open in order to be flushed")
836836

837-
if tcflush(cint(port.handle), TCIOFLUSH) == -1:
837+
if tcdrain(cint(port.handle)) == -1:
838838
raiseOSError(osLastError())
839839

840840
proc close*(port: SerialPort | AsyncSerialPort) =

0 commit comments

Comments
 (0)