From 49c62879b8e3df0f0126b8ad844509bb79e016e5 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Wed, 16 Oct 2013 23:05:50 +0000 Subject: [PATCH] discard errno = 0 errors --- term/term.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/term/term.go b/term/term.go index 5929c2caa1..8c53a20ca6 100644 --- a/term/term.go +++ b/term/term.go @@ -21,11 +21,19 @@ type Winsize struct { func GetWinsize(fd uintptr) (*Winsize, error) { ws := &Winsize{} _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(ws))) + // Skipp errno = 0 + if err == 0 { + return ws, nil + } return ws, err } func SetWinsize(fd uintptr, ws *Winsize) error { _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws))) + // Skipp errno = 0 + if err == 0 { + return nil + } return err }