Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
0335-Respect-proto_dist-flag-when-specified-mul...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0335-Respect-proto_dist-flag-when-specified-multiple-time.patch of Package erlang
From 4de3cc94406f546948ac53119c43c3146798623e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= <jonatanklosko@gmail.com> Date: Mon, 15 Jul 2024 19:55:11 +0700 Subject: [PATCH] Respect -proto_dist flag when specified multiple times --- lib/kernel/src/net_kernel.erl | 36 ++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/lib/kernel/src/net_kernel.erl b/lib/kernel/src/net_kernel.erl index f99e847c10..485a033dc9 100644 --- a/lib/kernel/src/net_kernel.erl +++ b/lib/kernel/src/net_kernel.erl @@ -180,6 +180,7 @@ in the Erlang Reference Manual. -type connection_type() :: normal | hidden. -include("net_address.hrl"). +-include_lib("kernel/include/logger.hrl"). %% Relaxed typing to allow ets:select without Dialyzer complains. -record(connection, { @@ -2399,12 +2400,8 @@ split_node(Name) -> %% %% protocol_childspecs() -> - case init:get_argument(proto_dist) of - {ok, [Protos]} -> - protocol_childspecs(Protos); - _ -> - protocol_childspecs(["inet_tcp"]) - end. + Protos = proto_dist_argument(), + protocol_childspecs(Protos). protocol_childspecs([]) -> []; @@ -2456,17 +2453,31 @@ hidden_argument() -> false end. +%%% +%%% -proto_dist command line argument +%%% + +proto_dist_argument() -> + case init:get_argument(proto_dist) of + {ok, [Protos | Rest]} -> + case Rest of + [] -> + ok; + _ -> + ?LOG_WARNING("Multiple -proto_dist given to erl, using the first, ~p", [Protos]) + end, + Protos; + _ -> + ["inet_tcp"] + end. + %% %% Start all protocols %% start_protos(Node, CleanHalt, Listen) -> - case init:get_argument(proto_dist) of - {ok, [Protos]} -> - start_protos(Node, Protos, CleanHalt, Listen); - _ -> - start_protos(Node, ["inet_tcp"], CleanHalt, Listen) - end. + Protos = proto_dist_argument(), + start_protos(Node, Protos, CleanHalt, Listen). start_protos(Node, Ps, CleanHalt, Listen) -> Listeners = case Listen of @@ -3011,4 +3022,3 @@ opts_node(Op, Node, Opts, From, #state{req_map = ReqMap0} = S0) -> _ -> async_reply({reply, {error, noconnection}, S0}, From) end. - -- 2.43.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor