implement Send for process::Command on unix

closes https://github.com/rust-lang/rust/issues/47751
This commit is contained in:
Corentin Henry 2018-01-25 15:08:48 -08:00
parent 9fd7da904b
commit 831ff77570

View file

@ -87,6 +87,11 @@ pub enum Stdio {
Fd(FileDesc),
}
// Command is not Send by default due to the Command.argv field containing a raw pointers. However
// it is safe to implement Send, because anyway, these pointers point to memory owned by the
// Command.args field.
unsafe impl Send for Command {}
impl Command {
pub fn new(program: &OsStr) -> Command {
let mut saw_nul = false;