Do not use stream encoders

Marshall the raw objects for the sync pipes so that no new line chars
are left behind in the pipe causing errors.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2016-01-25 18:15:44 -08:00
parent 3268a1ea00
commit ddcee3cc2a
7 changed files with 33 additions and 21 deletions

View File

@@ -3,7 +3,6 @@
package libcontainer
import (
"encoding/json"
"io/ioutil"
"os"
"path/filepath"
@@ -12,6 +11,7 @@ import (
"github.com/docker/docker/pkg/mount"
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/utils"
)
func newTestRoot() (string, error) {
@@ -179,5 +179,5 @@ func marshal(path string, v interface{}) error {
return err
}
defer f.Close()
return json.NewEncoder(f).Encode(v)
return utils.WriteJSON(f, v)
}