diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-05-05 16:00:01 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-05-05 16:00:01 +0200 |
| commit | 78b251cbd7147f7550d3ac1ac36f7ccaa6c47161 (patch) | |
| tree | be940dd891027812db6aa18ff127d1cf56ea63e0 /vm/vmimpl/console.go | |
| parent | 31ea20ce83aa7ca21b4d0ef28d8375a058292a5a (diff) | |
all: fix too long lines
Not sure why I have not seen warnings about
these lines on another machine...
Diffstat (limited to 'vm/vmimpl/console.go')
| -rw-r--r-- | vm/vmimpl/console.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vm/vmimpl/console.go b/vm/vmimpl/console.go index 53075820f..07c9b9d27 100644 --- a/vm/vmimpl/console.go +++ b/vm/vmimpl/console.go @@ -27,7 +27,8 @@ func OpenConsole(con string) (rc io.ReadCloser, err error) { } }() var term unix.Termios - if _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCGETS, uintptr(unsafe.Pointer(&term))); errno != 0 { + _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCGETS, uintptr(unsafe.Pointer(&term))) + if errno != 0 { return nil, fmt.Errorf("failed to get console termios: %v", errno) } // no parity bit, only need 1 stop bit, no hardware flowcontrol @@ -35,12 +36,14 @@ func OpenConsole(con string) (rc io.ReadCloser, err error) { // ignore modem controls term.Cflag |= unix.B115200 | unix.CS8 | unix.CLOCAL | unix.CREAD // setup for non-canonical mode - term.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON + term.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | + unix.IGNCR | unix.ICRNL | unix.IXON term.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN term.Oflag &^= unix.OPOST term.Cc[unix.VMIN] = 0 term.Cc[unix.VTIME] = 10 // 1 second timeout - if _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCSETS, uintptr(unsafe.Pointer(&term))); errno != 0 { + _, _, errno = syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCSETS, uintptr(unsafe.Pointer(&term))) + if errno != 0 { return nil, fmt.Errorf("failed to get console termios: %v", errno) } tmp := fd |
