diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 3b551c7e0..9fcfecf51 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -30,6 +30,7 @@ Curtis White Cyrille Morvan Dale Anson Dan Armbrust +Daniel Spilker Danno Ferrin Davanum Srinivas David A. Herman diff --git a/WHATSNEW b/WHATSNEW index 6856f435b..d621d3921 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -23,6 +23,9 @@ Fixed bugs: * and are working together. Bugzilla report 27218 +* I/O-intensive processes hung when executed via . + Bugzilla reports 23893/26852. + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/Execute.java b/src/main/org/apache/tools/ant/taskdefs/Execute.java index da2dd31f0..84556777c 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Execute.java +++ b/src/main/org/apache/tools/ant/taskdefs/Execute.java @@ -17,6 +17,7 @@ package org.apache.tools.ant.taskdefs; +import java.io.OutputStream; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; @@ -509,6 +510,18 @@ public class Execute { Project.MSG_VERBOSE); } } + + OutputStream dummyOut = new OutputStream() { + public void write(int b) throws IOException { + } + }; + + ExecuteStreamHandler streamHandler = new PumpStreamHandler(dummyOut); + streamHandler.setProcessErrorStream(process.getErrorStream()); + streamHandler.setProcessOutputStream(process.getInputStream()); + streamHandler.start(); + process.getOutputStream().close(); + project.log("spawned process " + process.toString(), Project.MSG_VERBOSE); }