mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
eval: Use os.DevNull instead of hardcoding /dev/null.
/dev/null does not exist on Windows.
This commit is contained in:
parent
5968460d61
commit
c496324653
|
@ -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}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user