Merge pull request #2256 from dotcloud/discard_errno_0_errors

- Runtime: discard errno = 0 errors
Upstream-commit: 6ee2964a4ff1a6acd6023ff17ece3482ad4848be
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-10-16 16:22:03 -07:00
+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
}