Changeset 13090


Ignore:
Timestamp:
12/10/10 15:58:09 (12 years ago)
Author:
vvoutilainen
Message:

Make --batch exit, use Lisp.exit() in places where applicable so
that the streams are flushed, hence allowing --eval output
to be flushed.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Extensions.java

    r12440 r13090  
    228228    public LispObject execute()
    229229    {
     230      ((Stream)Symbol.STANDARD_OUTPUT.getSymbolValue())._finishOutput();
     231      ((Stream)Symbol.ERROR_OUTPUT.getSymbolValue())._finishOutput();
    230232      exit(0);
    231233      return LispThread.currentThread().nothing();
  • trunk/abcl/src/org/armedbear/lisp/Interpreter.java

    r13063 r13090  
    245245                    } else {
    246246                        System.err.println("No argument supplied to --eval");
    247                         System.exit(1);
     247                        exit(1);
    248248                    }
    249249                } else if (arg.equals("--load") ||
     
    253253                    } else {
    254254                        System.err.println("No argument supplied to --load");
    255                         System.exit(1);
     255                        exit(1);
    256256                    }
    257257                } else {
     
    293293                            sb.append(separator);
    294294                            System.err.print(sb.toString());
    295                             System.exit(2);
     295                            exit(2);
    296296                        }
    297297                        ++i;
     
    299299                        // Shouldn't happen.
    300300                        System.err.println("No argument supplied to --eval");
    301                         System.exit(1);
     301                        exit(1);
    302302                    }
    303303                } else if (arg.equals("--load") ||
     
    314314                        // Shouldn't happen.
    315315                        System.err.println("No argument supplied to --load");
    316                         System.exit(1);
     316                        exit(1);
    317317                    }
    318318                }
    319319            }
     320        }
     321        if (_BATCH_MODE_.getSymbolValue() == T) {
     322            exit(0);
    320323        }
    321324    }
     
    438441                Debug.trace(e);
    439442            }
    440         } else
     443        } else {
     444            ((Stream)Symbol.STANDARD_OUTPUT.getSymbolValue())._finishOutput();
     445            ((Stream)Symbol.ERROR_OUTPUT.getSymbolValue())._finishOutput();
    441446            System.exit(status);
     447        }
    442448    }
    443449
  • trunk/abcl/src/org/armedbear/lisp/Primitives.java

    r12950 r13090  
    15971597
    15981598            //###FIXME: Bail out, but do it nicer...
    1599             System.exit(1);
     1599            exit(1);
    16001600            return NIL;
    16011601        }
  • trunk/abcl/src/org/armedbear/lisp/java/swing/REPLConsole.java

    r12749 r13090  
    303303    } catch (Throwable e) {
    304304      e.printStackTrace();
    305       System.exit(1);
     305      exit(1);
    306306    }
    307307    final REPLConsole d = new REPLConsole(repl);
Note: See TracChangeset for help on using the changeset viewer.