Move rest of console functions to pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
a77846506b
commit
824ee83816
2 changed files with 22 additions and 26 deletions
|
@ -44,3 +44,17 @@ func Setup(rootfs, consolePath, mountLabel string) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func OpenAndDup(consolePath string) error {
|
||||
slave, err := system.OpenTerminal(consolePath, syscall.O_RDWR)
|
||||
if err != nil {
|
||||
return fmt.Errorf("open terminal %s", err)
|
||||
}
|
||||
if err := system.Dup2(slave.Fd(), 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := system.Dup2(slave.Fd(), 1); err != nil {
|
||||
return err
|
||||
}
|
||||
return system.Dup2(slave.Fd(), 2)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue