aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/dist_util.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-02-26 16:59:39 +0100
committerSverker Eriksson <[email protected]>2018-03-02 19:16:48 +0100
commit2709c93ede0be977ac13543d0fabe8ff3c27f4cc (patch)
treed29bee3a3ef0a4b5f75778bf964808cc3ad64d6f /lib/kernel/src/dist_util.erl
parent7917c31757994f4f2fd344d0529de8bb193adc85 (diff)
downloadotp-2709c93ede0be977ac13543d0fabe8ff3c27f4cc.tar.gz
otp-2709c93ede0be977ac13543d0fabe8ff3c27f4cc.tar.bz2
otp-2709c93ede0be977ac13543d0fabe8ff3c27f4cc.zip
kernel: Remove DFLAGS_ALL from dist.hrl
and remove use in dist_util:check_mandatory
Diffstat (limited to 'lib/kernel/src/dist_util.erl')
-rw-r--r--lib/kernel/src/dist_util.erl20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/kernel/src/dist_util.erl b/lib/kernel/src/dist_util.erl
index 5871e7e8ee..5614b80802 100644
--- a/lib/kernel/src/dist_util.erl
+++ b/lib/kernel/src/dist_util.erl
@@ -215,8 +215,7 @@ check_dflags(#hs_data{other_node = Node,
#erts_dflags{}=EDF) ->
Mandatory = (EDF#erts_dflags.mandatory bor RequiredFlags),
- Missing = check_mandatory(0, ?DFLAGS_ALL, Mandatory,
- OtherFlags, []),
+ Missing = check_mandatory(Mandatory, OtherFlags, []),
case Missing of
[] ->
ok;
@@ -236,21 +235,20 @@ check_dflags(#hs_data{other_node = Node,
?shutdown2(Node, {check_dflags_failed, Missing})
end.
-check_mandatory(_Bit, 0, _Mandatory, _OtherFlags, Missing) ->
+check_mandatory(0, _OtherFlags, Missing) ->
Missing;
-check_mandatory(Bit, Left, Mandatory, OtherFlags, Missing) ->
- DFlag = (1 bsl Bit),
- NewLeft = Left band (bnot DFlag),
- NewMissing = case {DFlag band Mandatory,
- DFlag band OtherFlags} of
- {DFlag, 0} ->
+check_mandatory(Mandatory, OtherFlags, Missing) ->
+ Left = Mandatory band (Mandatory - 1), % clear lowest set bit
+ DFlag = Mandatory bxor Left, % only lowest set bit
+ NewMissing = case DFlag band OtherFlags of
+ 0 ->
%% Mandatory and missing...
[dflag2str(DFlag) | Missing];
_ ->
- %% Not mandatory or present...
+ %% Mandatory and present...
Missing
end,
- check_mandatory(Bit+1, NewLeft, Mandatory, OtherFlags, NewMissing).
+ check_mandatory(Left, OtherFlags, NewMissing).
%% No nodedown will be sent if we fail before this process has