From 8750f8cf9849dab741efbcf5b31c7aacf5597a28 Mon Sep 17 00:00:00 2001 From: Shamis Shukoor Date: Tue, 5 May 2020 17:44:36 +0200 Subject: [PATCH] checking epmd is start without a crash --- src/rebar_dist_utils.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rebar_dist_utils.erl b/src/rebar_dist_utils.erl index 366c9954..36fd26cd 100644 --- a/src/rebar_dist_utils.erl +++ b/src/rebar_dist_utils.erl @@ -51,13 +51,13 @@ find_options(State) -> %%% PRIVATE %%% %%%%%%%%%%%%%%% start(Name, Type, Opts) -> - case dist_up(net_kernel:start([Name, Type])) of - false -> - start_epmd(), - dist_up(net_kernel:start([Name, Type])) orelse warn_dist(); - true -> + case erl_epmd:names() of + {error, _} -> + start_epmd(); + {ok, _} -> ok end, + dist_up(net_kernel:start([Name, Type])) orelse warn_dist(), setup_cookie(Opts). dist_up({error,{{shutdown,{_,net_kernel,{'EXIT',nodistribution}}},_}}) -> false;