Export syncpipe fields

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-04-30 17:02:45 -07:00
parent dcd57b8b41
commit b4f098e706
1 changed files with 10 additions and 1 deletions

View File

@ -3,9 +3,10 @@ package nsinit
import (
"encoding/json"
"fmt"
"github.com/dotcloud/docker/pkg/libcontainer"
"io/ioutil"
"os"
"github.com/dotcloud/docker/pkg/libcontainer"
)
// SyncPipe allows communication to and from the child processes
@ -36,6 +37,14 @@ func NewSyncPipeFromFd(parendFd, childFd uintptr) (*SyncPipe, error) {
return s, nil
}
func (s *SyncPipe) Child() *os.File {
return s.child
}
func (s *SyncPipe) Parent() *os.File {
return s.parent
}
func (s *SyncPipe) SendToChild(context libcontainer.Context) error {
data, err := json.Marshal(context)
if err != nil {