Prevent child cargo process from messing with our stdin

By default, `spawn` inherits stderr/stdout/stderr of the parent
process, and so, if child, for example does fcntl(O_NONBLOCK), weird
stuff happens to us.

Closes https://github.com/rust-analyzer/lsp-server/pull/10
This commit is contained in:
Aleksey Kladov 2020-02-01 16:25:44 +01:00
parent a878f39b5e
commit 5559d6b8a8

View File

@ -343,6 +343,7 @@ impl WatchThread {
.args(&args)
.stdout(Stdio::piped())
.stderr(Stdio::null())
.stdin(Stdio::null())
.spawn()
.expect("couldn't launch cargo");