Skip to content

Commit 6f71b54

Browse files
authored
Merge pull request #14646 from rabbitmq/ignore-SIGINFO-and-SIGWINCH
rabbitmq_prelaunch: Ignore SIGINFO and SIGWINCH
2 parents 1158aca + 3a342bc commit 6f71b54

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

deps/rabbitmq_prelaunch/src/rabbit_prelaunch_sighandler.erl

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@
2828
%% we can't handle SIGCONT, the signal used to resume the
2929
%% program. Unfortunately, it makes a SIGTSTP handler less
3030
%% useful here.
31-
sigtstp => ignore
31+
sigtstp => ignore,
32+
33+
%% SIGINFO is triggered on *BSD systems by Ctrl+T to query the status
34+
%% of the program. Things like the progress of a task.
35+
siginfo => ignore,
36+
37+
%% SIGWINCH is triggered when the terminal window size changes to
38+
%% allow the prograp to redraw its output.
39+
sigwinch => ignore
3240
}).
3341

3442
-define(SIGNAL_HANDLED_BY_ERLANG(Signal),
@@ -55,13 +63,13 @@ setup() ->
5563
end.
5664

5765
init(_Args) ->
58-
maps:fold(
66+
maps:foreach(
5967
fun
60-
(Signal, _, Ret) when ?SIGNAL_HANDLED_BY_ERLANG(Signal) -> Ret;
61-
(Signal, default, ok) -> os:set_signal(Signal, default);
62-
(Signal, ignore, ok) -> os:set_signal(Signal, ignore);
63-
(Signal, _, ok) -> os:set_signal(Signal, handle)
64-
end, ok, ?SIGNALS_HANDLED_BY_US),
68+
(Signal, _) when ?SIGNAL_HANDLED_BY_ERLANG(Signal) -> ok;
69+
(Signal, default) -> catch os:set_signal(Signal, default);
70+
(Signal, ignore) -> catch os:set_signal(Signal, ignore);
71+
(Signal, _) -> catch os:set_signal(Signal, handle)
72+
end, ?SIGNALS_HANDLED_BY_US),
6573
{ok, #{}}.
6674

6775
handle_event(Signal, State) when ?SIGNAL_HANDLED_BY_ERLANG(Signal) ->

0 commit comments

Comments
 (0)