aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src/release_handler_1.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-02-10 11:10:18 +0100
committerSiri Hansen <[email protected]>2016-02-10 11:13:35 +0100
commit8fba155bdc0b45f0504756d1ea695d9c53a44f80 (patch)
tree20743b3da8707882935c995c77e05b2da9ed7c29 /lib/sasl/src/release_handler_1.erl
parent439292ad4afe73243852fe79d5d467c325f382bf (diff)
parent264a5e804d6e23bf6c6916887669760cbf243caa (diff)
downloadotp-8fba155bdc0b45f0504756d1ea695d9c53a44f80.tar.gz
otp-8fba155bdc0b45f0504756d1ea695d9c53a44f80.tar.bz2
otp-8fba155bdc0b45f0504756d1ea695d9c53a44f80.zip
Merge branch 'nybek/speed_up_supervisor_count_children' into maint
* nybek/speed_up_supervisor_count_children: Speed up supervisor:count_children/1; simple_one_for_one Add supervisor:get_callback_module/1 OTP-13290
Diffstat (limited to 'lib/sasl/src/release_handler_1.erl')
-rw-r--r--lib/sasl/src/release_handler_1.erl33
1 files changed, 2 insertions, 31 deletions
diff --git a/lib/sasl/src/release_handler_1.erl b/lib/sasl/src/release_handler_1.erl
index 5e9a35ab4c..a6325270a5 100644
--- a/lib/sasl/src/release_handler_1.erl
+++ b/lib/sasl/src/release_handler_1.erl
@@ -676,48 +676,19 @@ maybe_get_dynamic_mods(Name, Pid) ->
error(get_modules_failed)
end.
-%% XXXX
-%% Note: The following is a terrible hack done in order to resolve the
-%% problem stated in ticket OTP-3452.
-
-%% XXXX NOTE WELL: This record is from supervisor.erl. Also the record
-%% name is really `state'.
--record(supervisor_state, {name,
- strategy,
- children = [],
- dynamics = [],
- intensity,
- period,
- restarts = [],
- module,
- args}).
-
%% Return the name of the call-back module that implements the
%% (top) supervisor SupPid.
%% Returns: {ok, Module} | {error,undefined}
%%
get_supervisor_module(SupPid) ->
- case catch get_supervisor_module1(SupPid) of
- {ok, Module} when is_atom(Module) ->
+ case catch supervisor:get_callback_module(SupPid) of
+ Module when is_atom(Module) ->
{ok, Module};
_Other ->
io:format("~w: reason: ~w~n", [SupPid, _Other]),
{error, undefined}
end.
-get_supervisor_module1(SupPid) ->
- {status, _Pid, {module, _Mod},
- [_PDict, _SysState, _Parent, _Dbg, Misc]} = sys:get_status(SupPid),
- %% 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)}.
-
%%-----------------------------------------------------------------
%% Func: do_soft_purge/3
%% Args: Mod = atom()