Changeset 6049


Ignore:
Timestamp:
2003-11-28T17:54:51+13:00 (20 years ago)
Author:
jmt12
Message:

Removed the commented out deadlocking code, and ensured the correct status was returned when a process is cancelled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/shell/GShell.java

    r5923 r6049  
    8181    /** Element in status type enumeration. */
    8282    static final public int OK = 1;
     83    static final public int CANCELLED = 2;
    8384    /** Element in process type name enumeration. */
    8485    static public String GSHELL_BUILD = "gshell_build";
     
    239240        }
    240241
    241         /** This causes Phind to deadlock
    242         String eline = null;
    243         String stdinline = null;
    244         while ((( eline = ebr.readLine()) != null || (stdinline = stdinbr.readLine()) != null) && !hasSignalledStop()) {
    245         if(eline != null) {
    246             System.err.print("*");
    247             if(progress != null) {
    248             progress.parse(eline);
    249             }
    250             if(bos != null) {
    251             try {
    252                 bos.write(eline.getBytes(), 0, eline.length());
    253             }
    254             catch(Exception error) {
    255                 Gatherer.printStackTrace(error);
    256             }
    257             }
    258             fireMessage(type, typeAsString(type) + "> " + eline, status);
    259         }
    260         if(stdinline != null) {
    261             System.err.print("+");
    262             fireMessage(type, typeAsString(type) + "> " + stdinline, status);
    263         }
    264         }
    265         */
    266 
    267242        if(!hasSignalledStop()) {
    268243        // Now display final message based on exit value
     
    284259        prcs.getOutputStream().close();
    285260        prcs.destroy();
    286         status = ERROR;
     261        status = CANCELLED;
    287262        }
    288263    }
Note: See TracChangeset for help on using the changeset viewer.