diff options
author | Lukas Larsson <[email protected]> | 2018-05-03 20:20:52 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2018-05-15 10:21:53 +0200 |
commit | 6dcc96f4c8a14e05398a1ee8c4c5ccc7f2fbe778 (patch) | |
tree | 1b135f05da52197e23ff61b4b74b5f362ac538c3 /lib/kernel/src/erl_signal_handler.erl | |
parent | cafff554ed7c8b820a7758b10aa32fc699f341eb (diff) | |
download | otp-6dcc96f4c8a14e05398a1ee8c4c5ccc7f2fbe778.tar.gz otp-6dcc96f4c8a14e05398a1ee8c4c5ccc7f2fbe778.tar.bz2 otp-6dcc96f4c8a14e05398a1ee8c4c5ccc7f2fbe778.zip |
kernel: Refactor erl_signal_handler startup
Diffstat (limited to 'lib/kernel/src/erl_signal_handler.erl')
-rw-r--r-- | lib/kernel/src/erl_signal_handler.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/kernel/src/erl_signal_handler.erl b/lib/kernel/src/erl_signal_handler.erl index 22f235d4e4..b76c2a217a 100644 --- a/lib/kernel/src/erl_signal_handler.erl +++ b/lib/kernel/src/erl_signal_handler.erl @@ -19,12 +19,21 @@ -module(erl_signal_handler). -behaviour(gen_event). --export([init/1, format_status/2, +-export([start/0, init/1, format_status/2, handle_event/2, handle_call/2, handle_info/2, terminate/2, code_change/3]). -record(state,{}). +start() -> + %% add signal handler + case whereis(erl_signal_server) of + %% in case of minimal mode + undefined -> ok; + _ -> + gen_event:add_handler(erl_signal_server, erl_signal_handler, []) + end. + init(_Args) -> {ok, #state{}}. |