discard errno = 0 errors

Upstream-commit: 49c62879b8e3df0f0126b8ad844509bb79e016e5
Component: engine
This commit is contained in:
Victor Vieux
2013-10-16 23:05:50 +00:00
parent 4e221a5f03
commit 8150e959e4
+8
View File
@@ -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
}