aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/sshc_sup.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-03-21 19:50:49 +0100
committerHans Nilsson <[email protected]>2017-04-07 10:23:34 +0200
commit6158cb432092c47e178b4dc1177b46cb8c310ab4 (patch)
tree8d6d5ff1f0f2b70eb7bc1cbe4e5fa5e440e3764e /lib/ssh/src/sshc_sup.erl
parent57d994270d63e7a9ce80eece3c1c3aeca79d3ea4 (diff)
downloadotp-6158cb432092c47e178b4dc1177b46cb8c310ab4.tar.gz
otp-6158cb432092c47e178b4dc1177b46cb8c310ab4.tar.bz2
otp-6158cb432092c47e178b4dc1177b46cb8c310ab4.zip
ssh: Fix supervisors, start daemon and connect code
Remove many internal options and made them as explicit arguments.
Diffstat (limited to 'lib/ssh/src/sshc_sup.erl')
-rw-r--r--lib/ssh/src/sshc_sup.erl14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/ssh/src/sshc_sup.erl b/lib/ssh/src/sshc_sup.erl
index 15858f36e1..9aab9d57e9 100644
--- a/lib/ssh/src/sshc_sup.erl
+++ b/lib/ssh/src/sshc_sup.erl
@@ -27,7 +27,7 @@
-behaviour(supervisor).
--export([start_link/1, start_child/1, stop_child/1]).
+-export([start_link/0, start_child/1, stop_child/1]).
%% Supervisor callback
-export([init/1]).
@@ -35,8 +35,8 @@
%%%=========================================================================
%%% API
%%%=========================================================================
-start_link(Args) ->
- supervisor:start_link({local, ?MODULE}, ?MODULE, [Args]).
+start_link() ->
+ supervisor:start_link({local, ?MODULE}, ?MODULE, []).
start_child(Args) ->
supervisor:start_child(?MODULE, Args).
@@ -51,18 +51,16 @@ stop_child(Client) ->
%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
--spec init( [term()] ) -> {ok,{supervisor:sup_flags(),[supervisor:child_spec()]}} | ignore .
-
-init(Args) ->
+init(_) ->
RestartStrategy = simple_one_for_one,
MaxR = 0,
MaxT = 3600,
- {ok, {{RestartStrategy, MaxR, MaxT}, [child_spec(Args)]}}.
+ {ok, {{RestartStrategy, MaxR, MaxT}, [child_spec()]}}.
%%%=========================================================================
%%% Internal functions
%%%=========================================================================
-child_spec(_) ->
+child_spec() ->
Name = undefined, % As simple_one_for_one is used.
StartFunc = {ssh_connection_handler, start_link, []},
Restart = temporary,