Skip to content

Commit

Permalink
implement Send for process::Command on unix
Browse files Browse the repository at this point in the history
closes #47751
  • Loading branch information
little-dude committed Jan 25, 2018
1 parent 9fd7da9 commit 831ff77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libstd/sys/unix/process/process_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 831ff77

Please sign in to comment.