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:
parent
902ccd0f18
commit
06d91f546f
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue