Permalink
Browse files

kernel: Heart port needs to be unregistered

When heart cycles we need to unregister the old port before
starting the new heart port program.

OTP-10591
  • Loading branch information...
1 parent 35c3235 commit e458e7b1d341c25b77bfccd833c3c53e10631b98 @psyeugenic psyeugenic committed Nov 23, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/kernel/src/heart.erl
View
@@ -46,6 +46,7 @@
-define(TIMEOUT, 5000).
-define(CYCLE_TIMEOUT, 10000).
+-define(HEART_PORT_NAME, heart_port).
%%---------------------------------------------------------------------
@@ -132,7 +133,7 @@ start_portprogram() ->
case wait_ack(Port) of
ok ->
%% register port so the vm can find it if need be
- register(heart_port, Port),
+ register(?HEART_PORT_NAME, Port),
{ok, Port};
{error, Reason} ->
report_problem({{port_problem, Reason},
@@ -228,6 +229,7 @@ no_reboot_shutdown(Port) ->
end.
do_cycle_port_program(Caller, Parent, Port, Cmd) ->
+ unregister(?HEART_PORT_NAME),
case catch start_portprogram() of
{ok, NewPort} ->
send_shutdown(Port),

0 comments on commit e458e7b

Please sign in to comment.