eval: Use os.DevNull instead of hardcoding /dev/null.

/dev/null does not exist on Windows.
This commit is contained in:
Qi Xiao 2017-12-03 22:47:12 +01:00
parent 5968460d61
commit c496324653

View File

@ -58,9 +58,9 @@ func init() {
}()
var err error
DevNull, err = os.Open("/dev/null")
DevNull, err = os.Open(os.DevNull)
if err != nil {
os.Stderr.WriteString("cannot open /dev/null, shell might not function normally")
os.Stderr.WriteString("cannot open " + os.DevNull + ", shell might not function normally\n")
}
DevNullClosedChan = &Port{File: DevNull, Chan: ClosedChan}
}