Rework for Linux & BSD differences

This commit is contained in:
Andre Renaud
2023-03-24 16:09:44 +13:00
committed by Cristian Maglie
parent ff38fe2a78
commit bafe313749
2 changed files with 1 additions and 8 deletions

View File

@@ -1,5 +1,4 @@
//go:build darwin || dragonfly || freebsd || netbsd || openbsd //go:build darwin || dragonfly || freebsd || netbsd || openbsd
// +build darwin dragonfly freebsd netbsd openbsd
package serial package serial

View File

@@ -87,11 +87,5 @@ func setTermSettingsBaudrate(speed int, settings *unix.Termios) (error, bool) {
} }
func (port *unixPort) Drain() error { func (port *unixPort) Drain() error {
// simulate drain with change settings with TCSETSW return unix.IoctlSetInt(port.handle, unix.TCSBRK, 1)
settings, err := port.getTermSettings()
if err != nil {
return err
}
return unix.IoctlSetTermios(port.handle, unix.TCSETSW, settings)
} }