From d03af073b42497c693238f1e5c25a1b5628d6af6 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 29 Jul 2011 14:03:36 -0700 Subject: [PATCH] Close pipes under failure scenario in compiletest --- src/test/compiletest/compiletest.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/compiletest/compiletest.rs b/src/test/compiletest/compiletest.rs index 0c1f85a4d85..e4f667d2730 100644 --- a/src/test/compiletest/compiletest.rs +++ b/src/test/compiletest/compiletest.rs @@ -748,11 +748,15 @@ mod procsrv { pipe_out.out, pipe_err.out); let pid = with_lib_path(execparms.lib_path, spawnproc); - if pid == -1 { fail; } os::libc::close(pipe_in.in); os::libc::close(pipe_in.out); os::libc::close(pipe_out.out); os::libc::close(pipe_err.out); + if pid == -1 { + os::libc::close(pipe_out.in); + os::libc::close(pipe_err.in); + fail; + } task::send(execparms.respchan, {pid: pid, outfd: pipe_out.in,