Browse Source

Avoid hanging listcab on large filesets (because writing the filelist

blocks before listcab's output is being read).

PR: 13546
Submitted by:	Jim Newsham <newsham at hotu.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273450 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
6739d29020
2 changed files with 6 additions and 3 deletions
  1. +2
    -0
      WHATSNEW
  2. +4
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/Cab.java

+ 2
- 0
WHATSNEW View File

@@ -28,6 +28,8 @@ Fixed bugs:
* The "plain" <junit> <formatter> could throw a NullPointerException
if an error occured in setUp.

* <cab> could hang listcab on large <fileset>s.

Other changes:
--------------



+ 4
- 3
src/main/org/apache/tools/ant/taskdefs/optional/Cab.java View File

@@ -266,9 +266,6 @@ public class Cab extends MatchingTask {
new String[] {"listcab"}, null,
baseDir, true);
OutputStream out = p.getOutputStream();
out.write(sb.toString().getBytes());
out.flush();
out.close();

// Create the stream pumpers to forward listcab's stdout and stderr to the log
// note: listcab is an interactive program, and issues prompts for every new line.
@@ -282,6 +279,10 @@ public class Cab extends MatchingTask {
(new Thread(outPump)).start();
(new Thread(errPump)).start();

out.write(sb.toString().getBytes());
out.flush();
out.close();

int result = -99; // A wild default for when the thread is interrupted

try {


Loading…
Cancel
Save