ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/nativelib/impl DefaultExecManager.java
Date Sat, 26 Jan 2002 04:52:38 GMT
donaldp     02/01/25 20:52:38

  Modified:    proposal/myrmidon/src/java/org/apache/aut/nativelib/impl
                        DefaultExecManager.java
  Log:
  Make sure the output streams that redirect to loggers are closed (and thus flushed) when
the native process completes.
  
  Revision  Changes    Path
  1.5       +11 -2     jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/nativelib/impl/DefaultExecManager.java
  
  Index: DefaultExecManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/nativelib/impl/DefaultExecManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultExecManager.java	26 Jan 2002 04:17:27 -0000	1.4
  +++ DefaultExecManager.java	26 Jan 2002 04:52:38 -0000	1.5
  @@ -22,6 +22,7 @@
   import org.apache.aut.nativelib.impl.launchers.ScriptCommandLauncher;
   import org.apache.aut.nativelib.impl.launchers.WinNTCommandLauncher;
   import org.apache.avalon.excalibur.io.FileUtil;
  +import org.apache.avalon.excalibur.io.IOUtil;
   
   /**
    * Default implementation of <code>ExecManager</code>.
  @@ -29,7 +30,7 @@
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    * @author <a href="mailto:thomas.haas@softwired-inc.com">Thomas Haas</a>
  - * @version $Revision: 1.4 $ $Date: 2002/01/26 04:17:27 $
  + * @version $Revision: 1.5 $ $Date: 2002/01/26 04:52:38 $
    * @see ExecManager
    * @see ExecMetaData
    */
  @@ -62,7 +63,15 @@
       {
           final LogOutputStream output = new LogOutputStream( handler, false );
           final LogOutputStream error = new LogOutputStream( handler, true );
  -        return execute( execMetaData, null, output, error, timeout );
  +        try
  +        {
  +            return execute( execMetaData, null, output, error, timeout );
  +        }
  +        finally
  +        {
  +            IOUtil.shutdownStream( output );
  +            IOUtil.shutdownStream( error );
  +        }
       }
   
       /**
  
  
  

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


Mime
View raw message