Skip to content

Commit d03af07

Browse files
committed
Close pipes under failure scenario in compiletest
1 parent b306a0d commit d03af07

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/compiletest/compiletest.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,15 @@ mod procsrv {
748748
pipe_out.out,
749749
pipe_err.out);
750750
let pid = with_lib_path(execparms.lib_path, spawnproc);
751-
if pid == -1 { fail; }
752751
os::libc::close(pipe_in.in);
753752
os::libc::close(pipe_in.out);
754753
os::libc::close(pipe_out.out);
755754
os::libc::close(pipe_err.out);
755+
if pid == -1 {
756+
os::libc::close(pipe_out.in);
757+
os::libc::close(pipe_err.in);
758+
fail;
759+
}
756760
task::send(execparms.respchan,
757761
{pid: pid,
758762
outfd: pipe_out.in,

0 commit comments

Comments
 (0)