diff options
| author | Matthew Sackman <matthew@lshift.net> | 2010-01-25 15:42:21 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2010-01-25 15:42:21 +0000 |
| commit | eef24935008ae65f561074323a26f14da56476cc (patch) | |
| tree | 52e77b2365199ef5c84fb15c04f2ed6ee1f75cfd /src | |
| parent | 81017e0a35e52d009a9c3407dd8bd2d8a5d30247 (diff) | |
| download | rabbitmq-server-git-eef24935008ae65f561074323a26f14da56476cc.tar.gz | |
fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/supervisor2.erl | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl index 6ff374de78..3b41c3768d 100644 --- a/src/supervisor2.erl +++ b/src/supervisor2.erl @@ -1,7 +1,7 @@ %% This file is a copy of supervisor.erl from the R13B-3 Erlang/OTP %% distribution, with the following modifications: %% -%% 1) the module name is gen_server2 +%% 1) the module name is supervisor2 %% %% 2) there is a new strategy called %% simple_one_for_one_terminate. This is exactly the same as for @@ -347,8 +347,9 @@ handle_info(Msg, State) -> %% Terminate this server. %% terminate(_Reason, State) when ?is_terminate_simple(State) -> - ok = terminate_simple_children( - hd(State#state.children), State#state.dynamics, State#state.name); + terminate_simple_children( + hd(State#state.children), State#state.dynamics, State#state.name), + ok; terminate(_Reason, State) -> terminate_children(State#state.children, State#state.name), ok. @@ -575,17 +576,10 @@ terminate_children([], _SupName, Res) -> Res. terminate_simple_children(Child, Dynamics, SupName) -> - ok = dict:fold( - fun (Pid, _Args, ok) -> - case shutdown(Pid, Child#child.shutdown) of - ok -> - ok; - {error, OtherReason} -> - report_error(shutdown_error, OtherReason, Child, - SupName), - ok - end - end, ok, Dynamics). + dict:fold(fun (Pid, _Args, _Any) -> + do_terminate(Child#child{pid = Pid}, SupName) + end, ok, Dynamics), + ok. do_terminate(Child, SupName) when Child#child.pid =/= undefined -> case shutdown(Child#child.pid, |
