summaryrefslogtreecommitdiff
path: root/lib/ssh/src/ssh_controller.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ssh/src/ssh_controller.erl')
-rw-r--r--lib/ssh/src/ssh_controller.erl16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/ssh/src/ssh_controller.erl b/lib/ssh/src/ssh_controller.erl
index 4b8f5a7e8e..d8fbc8d0f2 100644
--- a/lib/ssh/src/ssh_controller.erl
+++ b/lib/ssh/src/ssh_controller.erl
@@ -104,11 +104,17 @@ handle_call({start_system_subsystem, Sup, Address, Port, Profile, Options, Child
handle_call({stop_system,SysSup}, _From, D) ->
- case supervisor:which_children(SysSup) of
- [] ->
- ssh_system_sup:stop_system(D#data.role, SysSup);
- _X ->
- ok
+ try
+ case supervisor:which_children(SysSup) of
+ [] ->
+ ssh_system_sup:stop_system(D#data.role, SysSup);
+ _X ->
+ ok
+ end
+ catch
+ _:_ ->
+ %% Already stopped (?)
+ skip
end,
{reply, ok, D}.