diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2018-10-03 10:31:01 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-10-03 10:32:03 -0700 |
commit | e215b9970ad82915a8d544b81b3c49d7d84a0eb0 (patch) | |
tree | ca7fafed97a41307243ab7fc84d0a19e285dee53 /runsc/boot/loader_test.go | |
parent | 77e43adeab4abcd301d76222e0304f551fbcf0cc (diff) |
runsc: Pass root container's stdio via FD.
We were previously using the sandbox process's stdio as the root container's
stdio. This makes it difficult/impossible to distinguish output application
output from sandbox output, such as panics, which are always written to stderr.
Also close the console socket when we are done with it.
PiperOrigin-RevId: 215585180
Change-Id: I980b8c69bd61a8b8e0a496fd7bc90a06446764e0
Diffstat (limited to 'runsc/boot/loader_test.go')
-rw-r--r-- | runsc/boot/loader_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runsc/boot/loader_test.go b/runsc/boot/loader_test.go index 0b363253d..ea8411a8b 100644 --- a/runsc/boot/loader_test.go +++ b/runsc/boot/loader_test.go @@ -101,7 +101,8 @@ func createLoader() (*Loader, func(), error) { return nil, nil, err } - l, err := New("foo", spec, conf, fd, -1 /* device fd */, []int{sandEnd}, false) + stdio := []int{int(os.Stdin.Fd()), int(os.Stdout.Fd()), int(os.Stderr.Fd())} + l, err := New("foo", spec, conf, fd, -1 /* device fd */, []int{sandEnd}, stdio, false) if err != nil { cleanup() return nil, nil, err |