aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_acceptor_sup.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2014-09-29 08:59:49 +0200
committerErlang/OTP <[email protected]>2014-09-29 08:59:49 +0200
commite218a4578f0ea24fb846ee433d48df98040ff573 (patch)
treebf3ce7b7f86235450e5267e43632ef4c116be1b0 /lib/ssh/src/ssh_acceptor_sup.erl
parentee4af1e0736f0ae1661fecd63c05c24c4067e4ea (diff)
parent19aa8b2e1e11f1da4723dbcce427831eca17d54e (diff)
downloadotp-e218a4578f0ea24fb846ee433d48df98040ff573.tar.gz
otp-e218a4578f0ea24fb846ee433d48df98040ff573.tar.bz2
otp-e218a4578f0ea24fb846ee433d48df98040ff573.zip
Merge branch 'ia/ssh/listner-restart/OTP-12168' into maint-17
* ia/ssh/listner-restart/OTP-12168: ssh: Adjust supervisor tree to make sure new listning options are honored ssh: Add test case for ssh:stop_listner
Diffstat (limited to 'lib/ssh/src/ssh_acceptor_sup.erl')
-rw-r--r--lib/ssh/src/ssh_acceptor_sup.erl13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/ssh/src/ssh_acceptor_sup.erl b/lib/ssh/src/ssh_acceptor_sup.erl
index 2be729d305..46fdef07d0 100644
--- a/lib/ssh/src/ssh_acceptor_sup.erl
+++ b/lib/ssh/src/ssh_acceptor_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -26,7 +26,7 @@
-module(ssh_acceptor_sup).
-behaviour(supervisor).
--export([start_link/1, start_child/2, stop_child/2]).
+-export([start_link/1, start_child/2, stop_child/3]).
%% Supervisor callback
-export([init/1]).
@@ -45,18 +45,17 @@ start_child(AccSup, ServerOpts) ->
{error, already_present} ->
Address = proplists:get_value(address, ServerOpts),
Port = proplists:get_value(port, ServerOpts),
- Name = id(Address, Port),
- supervisor:delete_child(?MODULE, Name),
+ stop_child(AccSup, Address, Port),
supervisor:start_child(AccSup, Spec);
Reply ->
Reply
end.
-stop_child(Address, Port) ->
+stop_child(AccSup, Address, Port) ->
Name = id(Address, Port),
- case supervisor:terminate_child(?MODULE, Name) of
+ case supervisor:terminate_child(AccSup, Name) of
ok ->
- supervisor:delete_child(?MODULE, Name);
+ supervisor:delete_child(AccSup, Name);
Error ->
Error
end.