8075604: jjs exits even when non-daemon threads are still active
authorsundar
Fri, 20 Mar 2015 20:04:18 +0530
changeset 29544 8151437996be
parent 29543 4d9f8f8b69a4
child 29545 60d4885a1a67
8075604: jjs exits even when non-daemon threads are still active Reviewed-by: attila, jlaskey
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java	Fri Mar 20 13:19:47 2015 +0300
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java	Fri Mar 20 20:04:18 2015 +0530
@@ -109,7 +109,10 @@
      */
     public static void main(final String[] args) {
         try {
-            System.exit(main(System.in, System.out, System.err, args));
+            final int exitCode = main(System.in, System.out, System.err, args);
+            if (exitCode != SUCCESS) {
+                System.exit(exitCode);
+            }
         } catch (final IOException e) {
             System.err.println(e); //bootstrapping, Context.err may not exist
             System.exit(IO_ERROR);