mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-28 16:34:13 +01:00
Deal with return values from starting/terminating supervisor (thanks to Stefan Strigler)
SVN Revision: 2204
This commit is contained in:
parent
5b09c35dea
commit
88d32b1064
@ -75,17 +75,27 @@ process(_Path, _Request) ->
|
|||||||
%%% BEHAVIOUR CALLBACKS
|
%%% BEHAVIOUR CALLBACKS
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
start(_Host, _Opts) ->
|
start(_Host, _Opts) ->
|
||||||
supervisor:start_child(
|
HTTPBindSupervisor =
|
||||||
ejabberd_sup,
|
|
||||||
{ejabberd_http_bind_sup,
|
{ejabberd_http_bind_sup,
|
||||||
{ejabberd_tmp_sup, start_link,
|
{ejabberd_tmp_sup, start_link,
|
||||||
[ejabberd_http_bind_sup, ejabberd_http_bind]},
|
[ejabberd_http_bind_sup, ejabberd_http_bind]},
|
||||||
permanent,
|
permanent,
|
||||||
infinity,
|
infinity,
|
||||||
supervisor,
|
supervisor,
|
||||||
[ejabberd_tmp_sup]}),
|
[ejabberd_tmp_sup]},
|
||||||
ok.
|
case supervisor:start_child(ejabberd_sup, HTTPBindSupervisor) of
|
||||||
|
{ok, _Pid} ->
|
||||||
|
ok;
|
||||||
|
{ok, _Pid, _Info} ->
|
||||||
|
ok;
|
||||||
|
{error, Error} ->
|
||||||
|
{'EXIT', {start_child_error, Error}}
|
||||||
|
end.
|
||||||
|
|
||||||
stop(_Host) ->
|
stop(_Host) ->
|
||||||
supervisor:terminate_child(ejabberd_sup, ejabberd_http_bind_sup),
|
case supervisor:terminate_child(ejabberd_sup, ejabberd_http_bind_sup) of
|
||||||
ok.
|
ok ->
|
||||||
|
ok;
|
||||||
|
{error, Error} ->
|
||||||
|
{'EXIT', {terminate_child_error, Error}}
|
||||||
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user