From 7d2a956cab249cba3992d8db1e47c3f9f7679296 Mon Sep 17 00:00:00 2001 From: Tzu-Hao Wei <1396431+socrateswei@users.noreply.github.com> Date: Wed, 18 Apr 2018 15:09:16 +0800 Subject: [PATCH] TCFLSH should use portable variable TCFLSH for ppc64 and mips is 0x5407. Get rid of hard code here. --- serial_linux.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/serial_linux.go b/serial_linux.go index 6469583..04b91dc 100644 --- a/serial_linux.go +++ b/serial_linux.go @@ -144,11 +144,10 @@ func (p *Port) Write(b []byte) (n int, err error) { // Discards data written to the port but not transmitted, // or data received but not read func (p *Port) Flush() error { - const TCFLSH = 0x540B _, _, errno := unix.Syscall( unix.SYS_IOCTL, uintptr(p.f.Fd()), - uintptr(TCFLSH), + uintptr(unix.TCFLSH), uintptr(unix.TCIOFLUSH), )