diff --git a/serial_bsd.go b/serial_bsd.go index 4db5b3d..4e1f226 100644 --- a/serial_bsd.go +++ b/serial_bsd.go @@ -1,5 +1,4 @@ //go:build darwin || dragonfly || freebsd || netbsd || openbsd -// +build darwin dragonfly freebsd netbsd openbsd package serial diff --git a/serial_linux.go b/serial_linux.go index 0ac0f39..c8a7651 100644 --- a/serial_linux.go +++ b/serial_linux.go @@ -87,11 +87,5 @@ func setTermSettingsBaudrate(speed int, settings *unix.Termios) (error, bool) { } func (port *unixPort) Drain() error { - // simulate drain with change settings with TCSETSW - settings, err := port.getTermSettings() - if err != nil { - return err - } - - return unix.IoctlSetTermios(port.handle, unix.TCSETSW, settings) + return unix.IoctlSetInt(port.handle, unix.TCSBRK, 1) }