From 78b251cbd7147f7550d3ac1ac36f7ccaa6c47161 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 5 May 2018 16:00:01 +0200 Subject: all: fix too long lines Not sure why I have not seen warnings about these lines on another machine... --- vm/vmimpl/console.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'vm/vmimpl/console.go') 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 -- cgit mrf-deployment