Skip to content

Commit

Permalink
rollback old build rules
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryk-dk committed May 9, 2022
1 parent 684eb1b commit 55fa2cc
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions v3/termutil/term_appengine.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build appengine
// +build appengine

package termutil

Expand Down
2 changes: 2 additions & 0 deletions v3/termutil/term_bsd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//go:build (darwin || freebsd || netbsd || openbsd || dragonfly) && !appengine
// +build darwin freebsd netbsd openbsd dragonfly
// +build !appengine

package termutil

Expand Down
1 change: 1 addition & 0 deletions v3/termutil/term_linux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build linux && !appengine
// +build linux,!appengine

package termutil

Expand Down
2 changes: 2 additions & 0 deletions v3/termutil/term_nix.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//go:build (linux || darwin || freebsd || netbsd || openbsd || dragonfly) && !appengine
// +build linux darwin freebsd netbsd openbsd dragonfly
// +build !appengine

package termutil

Expand Down
1 change: 1 addition & 0 deletions v3/termutil/term_solaris.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build solaris && !appengine
// +build solaris,!appengine

package termutil

Expand Down
1 change: 1 addition & 0 deletions v3/termutil/term_win.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build windows
// +build windows

package termutil

Expand Down
6 changes: 4 additions & 2 deletions v3/termutil/term_x.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//go:build (linux || darwin || freebsd || netbsd || openbsd || solaris || dragonfly) && !appengine
// +build linux darwin freebsd netbsd openbsd solaris dragonfly
// +build !appengine

package termutil

Expand Down Expand Up @@ -57,15 +59,15 @@ func lockEcho() error {
fd := tty.Fd()

if _, _, err := syscall.Syscall(sysIoctl, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&oldState))); err != 0 {
return fmt.Errorf("error when puts the terminal connected to the given file descriptor: %v", err)
return fmt.Errorf("error when puts the terminal connected to the given file descriptor: %w", err)
}

newState := oldState
newState.Lflag &^= syscall.ECHO
newState.Lflag |= syscall.ICANON | syscall.ISIG
newState.Iflag |= syscall.ICRNL
if _, _, e := syscall.Syscall(sysIoctl, fd, ioctlWriteTermios, uintptr(unsafe.Pointer(&newState))); e != 0 {
return fmt.Errorf("error update terminal settings: %v", e)
return fmt.Errorf("error update terminal settings: %w", e)
}
return nil
}
Expand Down

0 comments on commit 55fa2cc

Please sign in to comment.