diff options
author | Björn-Egil Dahlberg <[email protected]> | 2012-11-23 18:53:06 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2012-11-23 19:42:26 +0100 |
commit | e458e7b1d341c25b77bfccd833c3c53e10631b98 (patch) | |
tree | 0ab19bf962f7119f17f460aea574e6988b12d19a /lib/kernel/src/heart.erl | |
parent | 35c32355088eb86c3a118dc14dbc9bf5a6f2913b (diff) | |
download | otp-e458e7b1d341c25b77bfccd833c3c53e10631b98.tar.gz otp-e458e7b1d341c25b77bfccd833c3c53e10631b98.tar.bz2 otp-e458e7b1d341c25b77bfccd833c3c53e10631b98.zip |
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
Diffstat (limited to 'lib/kernel/src/heart.erl')
-rw-r--r-- | lib/kernel/src/heart.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/kernel/src/heart.erl b/lib/kernel/src/heart.erl index de287bfa43..87cb9d7f51 100644 --- a/lib/kernel/src/heart.erl +++ b/lib/kernel/src/heart.erl @@ -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), |