Skip to content

Commit 516356d

Browse files
tedhorstbrson
authored andcommitted
---
yaml --- r: 14198 b: refs/heads/try c: 9fde2a5 h: refs/heads/master v: v3
1 parent 7261ebd commit 516356d

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: a7a1152db5b7f8cde82eaf3d994f93f024f4e803
5+
refs/heads/try: 9fde2a54f47a84f34add6994c6c90100d83247fb
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/compiletest/procsrv.rs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,33 @@ fn run(lib_path: str, prog: str, args: [str],
5252

5353

5454
writeclose(pipe_in.out, input);
55-
let errput = readclose(pipe_err.in);
56-
let output = readclose(pipe_out.in);
55+
let p = comm::port();
56+
let ch = comm::chan(p);
57+
task::spawn_sched(1u) {||
58+
let errput = readclose(pipe_err.in);
59+
comm::send(ch, (2, errput));
60+
};
61+
task::spawn_sched(1u) {||
62+
let output = readclose(pipe_out.in);
63+
comm::send(ch, (1, output));
64+
};
5765
let status = run::waitpid(pid);
58-
ret {status: status, out: output, err: errput};
66+
let errs = "";
67+
let outs = "";
68+
let count = 2;
69+
while count > 0 {
70+
let stream = comm::recv(p);
71+
alt stream {
72+
(1, s) {
73+
outs = s;
74+
}
75+
(2, s) {
76+
errs = s;
77+
}
78+
};
79+
count -= 1;
80+
};
81+
ret {status: status, out: outs, err: errs};
5982
}
6083

6184
fn writeclose(fd: fd_t, s: option<str>) {

0 commit comments

Comments
 (0)