瀏覽代碼

Export syncpipe fields
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)

Michael Crosby 11 年之前
父節點
當前提交
a3e96abb5a
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      pkg/libcontainer/nsinit/sync_pipe.go

+ 10 - 1
pkg/libcontainer/nsinit/sync_pipe.go

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