aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl
diff options
context:
space:
mode:
authorSteve Vinoski <[email protected]>2010-03-26 13:39:35 -0400
committerBjörn Gustavsson <[email protected]>2010-05-05 11:14:47 +0200
commit0c687fa3336b46a015c6dcbc887cd6980e9dd7f1 (patch)
treef022565837357e7f9790a948069cee2eccb2b240 /lib/sasl
parentc032d352a8610b47b2e88fd871d5047468240f16 (diff)
downloadotp-0c687fa3336b46a015c6dcbc887cd6980e9dd7f1.tar.gz
otp-0c687fa3336b46a015c6dcbc887cd6980e9dd7f1.tar.bz2
otp-0c687fa3336b46a015c6dcbc887cd6980e9dd7f1.zip
fix sys:get_status backward compatibility for sasl release_handler_1
In R13B04 sys:get_status was modified to invoke format_status/2 in the callback module if the module exports that function. This resulted in a change to the term returned from calling sys:get_status on the supervisor module, since supervisor is a gen_server and gen_server exports format_status. The sasl release_handler_1 module had a dependency on the pre-R13B04 term returned by sys:get_status when invoked on a supervisor, so the R13B04 change broke that dependency. Change release_handler_1 to handle both the pre-R13B04 and R13B04 terms that sys:get_status can return from a supervisor.
Diffstat (limited to 'lib/sasl')
-rw-r--r--lib/sasl/src/release_handler_1.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sasl/src/release_handler_1.erl b/lib/sasl/src/release_handler_1.erl
index e3e3caba99..e2c37e4bf4 100644
--- a/lib/sasl/src/release_handler_1.erl
+++ b/lib/sasl/src/release_handler_1.erl
@@ -554,7 +554,13 @@ get_supervisor_module(SupPid) ->
get_supervisor_module1(SupPid) ->
{status, _Pid, {module, _Mod},
[_PDict, _SysState, _Parent, _Dbg, Misc]} = sys:get_status(SupPid),
- [_Name, State, _Type, _Time] = Misc,
+ %% supervisor Misc field changed at R13B04, handle old and new variants here
+ State = case Misc of
+ [_Name, State1, _Type, _Time] ->
+ State1;
+ [_Header, _Data, {data, [{"State", State2}]}] ->
+ State2
+ end,
%% Cannot use #supervisor_state{module = Module} = State.
{ok, element(#supervisor_state.module, State)}.