aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_sup.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ssh/src/ssh_sup.erl')
-rw-r--r--lib/ssh/src/ssh_sup.erl30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/ssh/src/ssh_sup.erl b/lib/ssh/src/ssh_sup.erl
index 5463401dcd..6be809b1bd 100644
--- a/lib/ssh/src/ssh_sup.erl
+++ b/lib/ssh/src/ssh_sup.erl
@@ -32,19 +32,19 @@
%%% Supervisor callback
%%%=========================================================================
init(_) ->
- SupFlags = {one_for_one, 10, 3600},
- Children = [child_spec(sshd_sup), child_spec(sshc_sup)], %%children(),
- {ok, {SupFlags, Children}}.
-
-%%%=========================================================================
-%%% Internal functions
-%%%=========================================================================
-child_spec(Name) ->
- StartFunc = {Name, start_link, []},
- Restart = permanent,
- Shutdown = infinity,
- Modules = [Name],
- Type = supervisor,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
-
+ SupFlags = #{strategy => one_for_one,
+ intensity => 10,
+ period => 3600
+ },
+ ChildSpecs = [#{id => Module,
+ start => {Module, start_link, []},
+ restart => permanent,
+ shutdown => brutal_kill,
+ type => supervisor,
+ modules => [Module]
+ }
+ || Module <- [sshd_sup,
+ sshc_sup]
+ ],
+ {ok, {SupFlags,ChildSpecs}}.