diff options
author | Sverker Eriksson <[email protected]> | 2016-11-22 14:57:39 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-11-22 14:57:39 +0100 |
commit | 0e2bde208e45bb24ae3d9fcd3db94b93882ecaec (patch) | |
tree | a6334828227fda954756453474429335aca89cd9 /erts/emulator/beam/erl_init.c | |
parent | 9563cd5b296fe589c8abe357710fbb79bc766d09 (diff) | |
parent | b62020124b3294be021d0d62073ba34cda1ae742 (diff) | |
download | otp-0e2bde208e45bb24ae3d9fcd3db94b93882ecaec.tar.gz otp-0e2bde208e45bb24ae3d9fcd3db94b93882ecaec.tar.bz2 otp-0e2bde208e45bb24ae3d9fcd3db94b93882ecaec.zip |
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/beam/erl_init.c')
-rw-r--r-- | erts/emulator/beam/erl_init.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c index b299ac8d64..165c440f71 100644 --- a/erts/emulator/beam/erl_init.c +++ b/erts/emulator/beam/erl_init.c @@ -2372,6 +2372,8 @@ system_cleanup(int flush_async) erts_exit_flush_async(); } +static int erts_exit_code; + static __decl_noreturn void __noreturn erts_exit_vv(int n, int flush_async, char *fmt, va_list args1, va_list args2) { @@ -2383,12 +2385,21 @@ erts_exit_vv(int n, int flush_async, char *fmt, va_list args1, va_list args2) if (fmt != NULL && *fmt != '\0') erl_error(fmt, args2); /* Print error message. */ - /* Produce an Erlang core dump if error */ + erts_exit_code = n; + + /* Produce an Erlang crash dump if error */ if (((n == ERTS_ERROR_EXIT && erts_no_crash_dump == 0) || n == ERTS_DUMP_EXIT) && erts_initialized) { erl_crash_dump_v((char*) NULL, 0, fmt, args1); } + erts_exit_epilogue(); +} + +__decl_noreturn void __noreturn erts_exit_epilogue(void) +{ + int n = erts_exit_code; + sys_tty_reset(n); if (n == ERTS_INTR_EXIT) |