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-myrmidon/aut/src/java/org/apache/aut/jprocess StdioRedirector.java
Date Tue, 25 Jun 2002 02:33:25 GMT
donaldp     2002/06/24 19:33:25

  Modified:    aut/src/java/org/apache/aut/jprocess StdioRedirector.java
  Log:
  Use a flag to determine whether Stdio has been redirected or not
  
  Revision  Changes    Path
  1.5       +9 -6      jakarta-ant-myrmidon/aut/src/java/org/apache/aut/jprocess/StdioRedirector.java
  
  Index: StdioRedirector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/src/java/org/apache/aut/jprocess/StdioRedirector.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StdioRedirector.java	26 Apr 2002 06:45:54 -0000	1.4
  +++ StdioRedirector.java	25 Jun 2002 02:33:25 -0000	1.5
  @@ -10,7 +10,6 @@
   import java.io.FileDescriptor;
   import java.io.FileInputStream;
   import java.io.FileOutputStream;
  -import java.io.IOException;
   import java.io.InputStream;
   import java.io.OutputStream;
   import java.io.PrintStream;
  @@ -38,6 +37,8 @@
       private static DemuxOutputStream c_output;
       private static DemuxOutputStream c_error;
   
  +    private static boolean c_installed;
  +
       /**
        * Private constructor to block instantiation.
        */
  @@ -53,9 +54,8 @@
        * @return true if installed, false if already installed
        */
       public static boolean install()
  -        throws IOException
       {
  -        if( c_input == System.in )
  +        if( c_installed )
           {
               //Already installed so lets ignore
               return false;
  @@ -74,6 +74,8 @@
           System.setOut( output );
           System.setErr( error );
   
  +        c_installed = true;
  +
           return true;
       }
   
  @@ -86,9 +88,8 @@
        * @return true if uninstalled, false if already uninstalled
        */
       public static boolean uninstall()
  -        throws IOException
       {
  -        if( c_input != System.in )
  +        if( !c_installed )
           {
               //Already uninstalled so lets ignore
               return false;
  @@ -108,6 +109,8 @@
           System.setIn( input );
           System.setOut( outputStream );
           System.setErr( errorStream );
  +
  +        c_installed = false;
   
           return true;
       }
  
  
  

--
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