let (p, ch) = SharedChan::new();
let ch_clone = ch.clone();
- do spawn {
+ spawn(proc() {
let _guard = io::ignore_io_error();
let mut error = error;
match error {
Some(ref mut e) => ch.send((2, e.read_to_end())),
None => ch.send((2, ~[]))
}
- }
- do spawn {
+ });
+ spawn(proc() {
let _guard = io::ignore_io_error();
let mut output = output;
match output {
Some(ref mut e) => ch_clone.send((1, e.read_to_end())),
None => ch_clone.send((1, ~[]))
}
- }
+ });
let status = self.finish();
trapped_io_error = true;
assert_eq!(e.kind, FileNotFound);
}).inside(|| -> Option<run::ProcessOutput> {
- run::process_output("no-binary-by-this-name-should-exist", [])
+ run::process_output("/no-binary-by-this-name-should-exist", [])
});
assert!(trapped_io_error);
assert!(opt_outp.is_none());
os::close(pipe_out.out as int);
os::close(pipe_err.out as int);
- do spawn {
+ spawn(proc() {
writeclose(pipe_in.out, "test");
- }
+ });
let actual = readclose(pipe_out.input);
readclose(pipe_err.input);
process.finish();