File 2501-ssh-fix-ssh_system_sup-naming-of-Host-Port-Profile.patch of Package erlang
From 57d994270d63e7a9ce80eece3c1c3aeca79d3ea4 Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Tue, 21 Mar 2017 15:44:44 +0100
Subject: [PATCH 1/9] ssh: fix ssh_system_sup naming of Host-Port-Profile
---
lib/ssh/src/ssh.erl | 2 +-
lib/ssh/src/ssh_acceptor_sup.erl | 7 +------
lib/ssh/src/ssh_system_sup.erl | 16 ++--------------
lib/ssh/src/sshd_sup.erl | 7 +------
4 files changed, 5 insertions(+), 27 deletions(-)
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index ff424b738..9047b7e0f 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -475,6 +475,6 @@ finalize_start(Host, Port, Profile, Options0, F) ->
end.
%%%----------------------------------------------------------------
-fmt_host(any) -> any;
+fmt_host(any) -> "any";
fmt_host(IP) when is_tuple(IP) -> inet:ntoa(IP);
fmt_host(Str) when is_list(Str) -> Str.
diff --git a/lib/ssh/src/ssh_acceptor_sup.erl b/lib/ssh/src/ssh_acceptor_sup.erl
index 77f782691..613d8fbc7 100644
--- a/lib/ssh/src/ssh_acceptor_sup.erl
+++ b/lib/ssh/src/ssh_acceptor_sup.erl
@@ -93,10 +93,5 @@ child_spec(Options) ->
{Name, StartFunc, Restart, Shutdown, Type, Modules}.
id(Address, Port, Profile) ->
- case is_list(Address) of
- true ->
- {ssh_acceptor_sup, any, Port, Profile};
- false ->
- {ssh_acceptor_sup, Address, Port, Profile}
- end.
+ {ssh_acceptor_sup, Address, Port, Profile}.
diff --git a/lib/ssh/src/ssh_system_sup.erl b/lib/ssh/src/ssh_system_sup.erl
index 5a58ef1c4..4083f666c 100644
--- a/lib/ssh/src/ssh_system_sup.erl
+++ b/lib/ssh/src/ssh_system_sup.erl
@@ -166,22 +166,10 @@ ssh_subsystem_child_spec(Options) ->
id(Sup, Address, Port, Profile) ->
- case is_list(Address) of
- true ->
- {Sup, any, Port, Profile};
- false ->
- {Sup, Address, Port, Profile}
- end.
+ {Sup, Address, Port, Profile}.
make_name(Address, Port, Profile) ->
- case is_list(Address) of
- true ->
- list_to_atom(lists:flatten(io_lib:format("ssh_system_~p_~p_~p_sup",
- [any, Port, Profile])));
- false ->
- list_to_atom(lists:flatten(io_lib:format("ssh_system_~p_~p_~p_sup",
- [Address, Port, Profile])))
- end.
+ list_to_atom(lists:flatten(io_lib:format("ssh_system_~s_~p_~p_sup", [Address, Port, Profile]))).
ssh_subsystem_sup([{_, Child, _, [ssh_subsystem_sup]} | _]) ->
Child;
diff --git a/lib/ssh/src/sshd_sup.erl b/lib/ssh/src/sshd_sup.erl
index 14f1937ab..791456839 100644
--- a/lib/ssh/src/sshd_sup.erl
+++ b/lib/ssh/src/sshd_sup.erl
@@ -103,12 +103,7 @@ child_spec(Address, Port, Options) ->
{Name, StartFunc, Restart, Shutdown, Type, Modules}.
id(Address, Port, Profile) ->
- case is_list(Address) of
- true ->
- {server, ssh_system_sup, any, Port, Profile};
- false ->
- {server, ssh_system_sup, Address, Port, Profile}
- end.
+ {server, ssh_system_sup, Address, Port, Profile}.
system_name([], _ ) ->
undefined;
--
2.12.2