Merge pull request #2256 from dotcloud/discard_errno_0_errors

- Runtime: discard errno = 0 errors
This commit is contained in:
Guillaume J. Charmes 2013-10-16 16:22:03 -07:00
commit 6ee2964a4f
1 changed files with 8 additions and 0 deletions

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
}