Skip to content

Commit

Permalink
use pty/tty terminology similar to github.com/kr/pty
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmood Ali committed May 10, 2019
1 parent f6a4b88 commit 7f76aed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions drivers/shared/executor/exec_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type execHelper struct {
logger hclog.Logger

// newTerminal function creates a tty appropriate for the command
// The returned master end of tty function is to be called after process start.
newTerminal func() (master func() (*os.File, error), slave *os.File, err error)
// The returned pty end of tty function is to be called after process start.
newTerminal func() (pty func() (*os.File, error), tty *os.File, err error)

// setTTY is a callback to configure the command with slave end of the tty of the terminal, when tty is enabled
setTTY func(tty *os.File) error
Expand Down Expand Up @@ -61,7 +61,7 @@ func (e *execHelper) runTTY(ctx context.Context, stream drivers.ExecTaskStream)

pty, err := ptyF()
if err != nil {
return fmt.Errorf("failed to get tty master: %v", err)
return fmt.Errorf("failed to get pty: %v", err)
}

defer pty.Close()
Expand Down
2 changes: 1 addition & 1 deletion drivers/shared/executor/executor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ func (l *LibcontainerExecutor) Exec(deadline time.Time, cmd string, args []strin

}

func (l *LibcontainerExecutor) newTerminalSocket() (master func() (*os.File, error), socket *os.File, err error) {
func (l *LibcontainerExecutor) newTerminalSocket() (pty func() (*os.File, error), tty *os.File, err error) {
parent, child, err := lutils.NewSockPair("socket")
if err != nil {
return nil, nil, fmt.Errorf("failed to create terminal: %v", err)
Expand Down

0 comments on commit 7f76aed

Please sign in to comment.