diff options
Diffstat (limited to 'stage1/Stage1Lib.scala')
-rw-r--r-- | stage1/Stage1Lib.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala index 9e500a3..43c4f84 100644 --- a/stage1/Stage1Lib.scala +++ b/stage1/Stage1Lib.scala @@ -251,14 +251,16 @@ ${files.sorted.mkString(" \\\n")} } def trapExitCode( code: => ExitCode ): ExitCode = { + val trapExitCodeBefore = NailgunLauncher.trapExitCode.get try{ - System.setSecurityManager( new TrapSecurityManager ) + NailgunLauncher.trapExitCode.set(true) code } catch { case CatchTrappedExitCode(exitCode) => + logger.stage1(s"caught exit code $exitCode") exitCode } finally { - System.setSecurityManager(NailgunLauncher.defaultSecurityManager) + NailgunLauncher.trapExitCode.set(trapExitCodeBefore) } } |