aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_channel_sup.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-02-13 15:12:17 +0100
committerHans Nilsson <[email protected]>2018-02-20 12:54:35 +0100
commit19265ed2beb0da5d02ed76456beda694ad98399a (patch)
tree92fef63a1950df4f8e98bb457363815be93064b7 /lib/ssh/src/ssh_channel_sup.erl
parent5ed873dc793fb0aa98da3c358f036142cb070188 (diff)
downloadotp-19265ed2beb0da5d02ed76456beda694ad98399a.tar.gz
otp-19265ed2beb0da5d02ed76456beda694ad98399a.tar.bz2
otp-19265ed2beb0da5d02ed76456beda694ad98399a.zip
ssh: Move starting of channel child to ssh_channel_sup
Diffstat (limited to 'lib/ssh/src/ssh_channel_sup.erl')
-rw-r--r--lib/ssh/src/ssh_channel_sup.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_channel_sup.erl b/lib/ssh/src/ssh_channel_sup.erl
index 6b01dc334d..deb0116958 100644
--- a/lib/ssh/src/ssh_channel_sup.erl
+++ b/lib/ssh/src/ssh_channel_sup.erl
@@ -26,7 +26,7 @@
-behaviour(supervisor).
--export([start_link/1, start_child/2]).
+-export([start_link/1, start_child/5]).
%% Supervisor callback
-export([init/1]).
@@ -37,7 +37,15 @@
start_link(Args) ->
supervisor:start_link(?MODULE, [Args]).
-start_child(Sup, ChildSpec) ->
+start_child(Sup, Callback, Id, Args, Exec) ->
+ ChildSpec =
+ #{id => make_ref(),
+ start => {ssh_channel, start_link, [self(), Id, Callback, Args, Exec]},
+ restart => temporary,
+ shutdown => 3600,
+ type => worker,
+ modules => [ssh_channel]
+ },
supervisor:start_child(Sup, ChildSpec).
%%%=========================================================================