diff options
Diffstat (limited to 'vendor/github.com/moby/term/tc.go')
-rw-r--r-- | vendor/github.com/moby/term/tc.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/vendor/github.com/moby/term/tc.go b/vendor/github.com/moby/term/tc.go index 87d263256f..65556027a6 100644 --- a/vendor/github.com/moby/term/tc.go +++ b/vendor/github.com/moby/term/tc.go @@ -1,20 +1,19 @@ -// +build !windows,!illumos,!solaris +// +build !windows package term import ( - "syscall" - "unsafe" - "golang.org/x/sys/unix" ) -func tcget(fd uintptr, p *Termios) syscall.Errno { - _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p))) - return err +func tcget(fd uintptr) (*Termios, error) { + p, err := unix.IoctlGetTermios(int(fd), getTermios) + if err != nil { + return nil, err + } + return p, nil } -func tcset(fd uintptr, p *Termios) syscall.Errno { - _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p))) - return err +func tcset(fd uintptr, p *Termios) error { + return unix.IoctlSetTermios(int(fd), setTermios, p) } |