diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-21 23:44:11 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-24 14:22:35 -0700 |
| commit | 262b958a4bedf419335069c95f054a22da48a88a (patch) | |
| tree | 85e225d8fe1f1418756687aec847a0f9b2166cae /src/libstd/rt | |
| parent | 6bb1df92511e7ecafe0554b01410f4e68d7bc66f (diff) | |
| download | rust-262b958a4bedf419335069c95f054a22da48a88a.tar.gz rust-262b958a4bedf419335069c95f054a22da48a88a.zip | |
Migrate std::run to libuv processes
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/io/process.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/uv/process.rs | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/libstd/rt/io/process.rs b/src/libstd/rt/io/process.rs index a5750211b49..ae087099d1f 100644 --- a/src/libstd/rt/io/process.rs +++ b/src/libstd/rt/io/process.rs @@ -57,7 +57,7 @@ pub struct ProcessConfig<'self> { /// 0 - stdin /// 1 - stdout /// 2 - stderr - io: ~[StdioContainer] + io: &'self [StdioContainer] } /// Describes what to do with a standard io stream for a child process. diff --git a/src/libstd/rt/uv/process.rs b/src/libstd/rt/uv/process.rs index a039bbc9fc0..f0d0afeb6aa 100644 --- a/src/libstd/rt/uv/process.rs +++ b/src/libstd/rt/uv/process.rs @@ -12,7 +12,6 @@ use prelude::*; use cell::Cell; use libc; use ptr; -use util; use vec; use rt::io::process::*; @@ -42,7 +41,7 @@ impl Process { /// /// Returns either the corresponding process object or an error which /// occurred. - pub fn spawn(&mut self, loop_: &uv::Loop, mut config: ProcessConfig, + pub fn spawn(&mut self, loop_: &uv::Loop, config: ProcessConfig, exit_cb: uv::ExitCallback) -> Result<~[Option<~UvPipeStream>], uv::UvError> { @@ -62,12 +61,12 @@ impl Process { err); } - let io = util::replace(&mut config.io, ~[]); + let io = config.io; let mut stdio = vec::with_capacity::<uvll::uv_stdio_container_t>(io.len()); let mut ret_io = vec::with_capacity(io.len()); unsafe { vec::raw::set_len(&mut stdio, io.len()); - for (slot, other) in stdio.iter().zip(io.move_iter()) { + for (slot, other) in stdio.iter().zip(io.iter()) { let io = set_stdio(slot as *uvll::uv_stdio_container_t, other, loop_); ret_io.push(io); @@ -126,9 +125,9 @@ impl Process { } unsafe fn set_stdio(dst: *uvll::uv_stdio_container_t, - io: StdioContainer, + io: &StdioContainer, loop_: &uv::Loop) -> Option<~UvPipeStream> { - match io { + match *io { Ignored => { uvll::set_stdio_container_flags(dst, uvll::STDIO_IGNORE); None |
