From 2d6a39e2e503a07e20d0b76ec30313ecacbdb8a1 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Fri, 20 Mar 2015 20:04:18 +0530 Subject: [PATCH] 8075604: jjs exits even when non-daemon threads are still active Reviewed-by: attila, jlaskey --- .../share/classes/jdk/nashorn/tools/Shell.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java index 58ab97c1896..ac630ccaa79 100644 --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java @@ -109,7 +109,10 @@ public class Shell { */ 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);