Fix reOpenDevNull

We should open /dev/null with os.O_RDWR, otherwise it won't be
possible writen to it

Signed-off-by: Chun Chen <ramichen@tencent.com>
This commit is contained in:
Chun Chen 2015-09-30 16:05:49 +08:00
parent 902ccd0f18
commit 06d91f546f
1 changed files with 1 additions and 1 deletions

View File

@ -332,7 +332,7 @@ func setupDevSymlinks(rootfs string) error {
// symlinks are resolved locally.
func reOpenDevNull() error {
var stat, devNullStat syscall.Stat_t
file, err := os.Open("/dev/null")
file, err := os.OpenFile("/dev/null", os.O_RDWR, 0)
if err != nil {
return fmt.Errorf("Failed to open /dev/null - %s", err)
}