Browse Source

seperate out the terminal functions from lxc to the pkg/term

  Since these functions are indepenent of lxc, and could be used by
  other drivers.

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Vincent Batts 11 years ago
parent
commit
de848a14ca
2 changed files with 4 additions and 4 deletions
  1. 2 1
      execdriver/lxc/driver.go
  2. 2 3
      pkg/term/driver.go

+ 2 - 1
execdriver/lxc/driver.go

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"github.com/dotcloud/docker/execdriver"
 	"github.com/dotcloud/docker/pkg/cgroups"
+	"github.com/dotcloud/docker/pkg/term"
 	"github.com/dotcloud/docker/utils"
 	"io/ioutil"
 	"log"
@@ -77,7 +78,7 @@ func (d *driver) Name() string {
 }
 
 func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error) {
-	if err := SetTerminal(c, pipes); err != nil {
+	if err := term.SetTerminal(c, pipes); err != nil {
 		return -1, err
 	}
 	configPath, err := d.generateLXCConfig(c)

+ 2 - 3
execdriver/lxc/term.go → pkg/term/driver.go

@@ -1,8 +1,7 @@
-package lxc
+package term
 
 import (
 	"github.com/dotcloud/docker/execdriver"
-	"github.com/dotcloud/docker/pkg/term"
 	"github.com/kr/pty"
 	"io"
 	"os"
@@ -51,7 +50,7 @@ func (t *TtyConsole) Master() *os.File {
 }
 
 func (t *TtyConsole) Resize(h, w int) error {
-	return term.SetWinsize(t.master.Fd(), &term.Winsize{Height: uint16(h), Width: uint16(w)})
+	return SetWinsize(t.master.Fd(), &Winsize{Height: uint16(h), Width: uint16(w)})
 }
 
 func (t *TtyConsole) attach(command *execdriver.Command, pipes *execdriver.Pipes) error {