ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant WHATSNEW
Date Fri, 23 Apr 2004 15:14:57 GMT
mbenson     2004/04/23 08:14:57

  Modified:    src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
                        Execute.java
               .        Tag: ANT_16_BRANCH WHATSNEW
  Log:
  Merge fix for hanging, I/O-intensive, spawned processes.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.68.2.8  +23 -16    ant/src/main/org/apache/tools/ant/taskdefs/Execute.java
  
  Index: Execute.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v
  retrieving revision 1.68.2.7
  retrieving revision 1.68.2.8
  diff -u -r1.68.2.7 -r1.68.2.8
  --- Execute.java	9 Mar 2004 17:01:33 -0000	1.68.2.7
  +++ Execute.java	23 Apr 2004 15:14:56 -0000	1.68.2.8
  @@ -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;
  @@ -208,18 +209,15 @@
       private static String[] getProcEnvCommand() {
           if (Os.isFamily("os/2")) {
               // OS/2 - use same mechanism as Windows 2000
  -            String[] cmd = {"cmd", "/c", "set" };
  -            return cmd;
  +            return new String[] {"cmd", "/c", "set" };
           } else if (Os.isFamily("windows")) {
               // Determine if we're running under XP/2000/NT or 98/95
  -            if (!Os.isFamily("win9x")) {
  -                // Windows XP/2000/NT
  -                String[] cmd = {"cmd", "/c", "set" };
  -                return cmd;
  -            } else {
  +            if (Os.isFamily("win9x")) {
                   // Windows 98/95
  -                String[] cmd = {"command.com", "/c", "set" };
  -                return cmd;
  +                return new String[] {"command.com", "/c", "set" };
  +            } else {
  +                // Windows XP/2000/NT/2003
  +                return new String[] {"cmd", "/c", "set" };
               }
           } else if (Os.isFamily("z/os") || Os.isFamily("unix")) {
               // On most systems one could use: /bin/sh -c env
  @@ -237,16 +235,13 @@
               return cmd;
           } else if (Os.isFamily("netware") || Os.isFamily("os/400")) {
               // rely on PATH
  -            String[] cmd = {"env"};
  -            return cmd;
  +            return new String[] {"env"};
           } else if (Os.isFamily("openvms")) {
  -            String[] cmd = {"show", "logical"};
  -            return cmd;
  +            return new String[] {"show", "logical"};
           } else {
               // MAC OS 9 and previous
               //TODO: I have no idea how to get it, someone must fix it
  -            String[] cmd = null;
  -            return cmd;
  +            return null;
           }
       }
   
  @@ -515,6 +510,18 @@
                       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);
       }
   
  
  
  
  No                   revision
  No                   revision
  1.503.2.82 +3 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.81
  retrieving revision 1.503.2.82
  diff -u -r1.503.2.81 -r1.503.2.82
  --- WHATSNEW	23 Apr 2004 14:33:33 -0000	1.503.2.81
  +++ WHATSNEW	23 Apr 2004 15:14:56 -0000	1.503.2.82
  @@ -71,6 +71,9 @@
   * UNC pathnames did not work for ANT_HOME or -lib locations on Windows.
     Bugzilla report 27922.
   
  +* I/O-intensive processes hung when executed via <exec spawn="true">.
  +  Bugzilla reports 23893/26852.
  +
   Other changes:
   --------------
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message