deps: Bump to cAdvisor v0.47.1
Signed-off-by: David Porter <david@porter.me>
This commit is contained in:
26
vendor/github.com/moby/term/term.go
generated
vendored
26
vendor/github.com/moby/term/term.go
generated
vendored
@@ -1,3 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
// Package term provides structures and helper functions to work with
|
||||
@@ -6,18 +7,14 @@ package term
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
// ErrInvalidState is returned if the state of the terminal is invalid.
|
||||
ErrInvalidState = errors.New("Invalid terminal state")
|
||||
)
|
||||
// ErrInvalidState is returned if the state of the terminal is invalid.
|
||||
var ErrInvalidState = errors.New("Invalid terminal state")
|
||||
|
||||
// State represents the state of the terminal.
|
||||
type State struct {
|
||||
@@ -81,7 +78,6 @@ func DisableEcho(fd uintptr, state *State) error {
|
||||
if err := tcset(fd, &newState); err != nil {
|
||||
return err
|
||||
}
|
||||
handleInterrupt(fd, state)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -93,7 +89,6 @@ func SetRawTerminal(fd uintptr) (*State, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
handleInterrupt(fd, oldState)
|
||||
return oldState, err
|
||||
}
|
||||
|
||||
@@ -103,18 +98,3 @@ func SetRawTerminal(fd uintptr) (*State, error) {
|
||||
func SetRawTerminalOutput(fd uintptr) (*State, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func handleInterrupt(fd uintptr, state *State) {
|
||||
sigchan := make(chan os.Signal, 1)
|
||||
signal.Notify(sigchan, os.Interrupt)
|
||||
go func() {
|
||||
for range sigchan {
|
||||
// quit cleanly and the new terminal item is on a new line
|
||||
fmt.Println()
|
||||
signal.Stop(sigchan)
|
||||
close(sigchan)
|
||||
RestoreTerminal(fd, state)
|
||||
os.Exit(1)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
Reference in New Issue
Block a user