aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/src/mnesia_frag.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-03-07 14:43:32 +0100
committerDan Gudmundsson <[email protected]>2011-03-07 14:43:43 +0100
commitf85c79166c0fcf39eaab62e39f392aa7ce83c9bf (patch)
treeb788b0986f13c700a380f325fecd5a08550dcc01 /lib/mnesia/src/mnesia_frag.erl
parent422c3eda25ce9cb67a815aac5b0254432b0d44f7 (diff)
parent728d949df2ce88587371d353b4379e3d349b0066 (diff)
downloadotp-f85c79166c0fcf39eaab62e39f392aa7ce83c9bf.tar.gz
otp-f85c79166c0fcf39eaab62e39f392aa7ce83c9bf.tar.bz2
otp-f85c79166c0fcf39eaab62e39f392aa7ce83c9bf.zip
Merge branch 'dgud/dialyzer-fixes' into dev
OTP-9107
Diffstat (limited to 'lib/mnesia/src/mnesia_frag.erl')
-rw-r--r--lib/mnesia/src/mnesia_frag.erl26
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/mnesia/src/mnesia_frag.erl b/lib/mnesia/src/mnesia_frag.erl
index a2958ab461..6cc16c80fd 100644
--- a/lib/mnesia/src/mnesia_frag.erl
+++ b/lib/mnesia/src/mnesia_frag.erl
@@ -1,7 +1,7 @@
%%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -448,13 +448,15 @@ do_remote_select(_ReplyTo, _Ref, [], _MatchSpec) ->
local_collect(Ref, Pid, Type, LocalMatch, OldSelectFun) ->
receive
- {local_select, Ref, LocalRes} ->
- remote_collect(Ref, Type, LocalRes, LocalMatch, OldSelectFun);
+ {local_select, Ref, ok} ->
+ remote_collect_ok(Ref, Type, LocalMatch, OldSelectFun);
+ {local_select, Ref, {error, Reason}} ->
+ remote_collect_error(Ref, Type, Reason, OldSelectFun);
{'EXIT', Pid, Reason} ->
- remote_collect(Ref, Type, {error, Reason}, [], OldSelectFun)
+ remote_collect_error(Ref, Type, Reason, OldSelectFun)
end.
-remote_collect(Ref, Type, LocalRes = ok, Acc, OldSelectFun) ->
+remote_collect_ok(Ref, Type, Acc, OldSelectFun) ->
receive
{remote_select, Ref, Node, RemoteRes} ->
case RemoteRes of
@@ -463,19 +465,21 @@ remote_collect(Ref, Type, LocalRes = ok, Acc, OldSelectFun) ->
ordered_set -> lists:merge(RemoteMatch, Acc);
_ -> RemoteMatch ++ Acc
end,
- remote_collect(Ref, Type, LocalRes, Matches, OldSelectFun);
+ remote_collect_ok(Ref, Type, Matches, OldSelectFun);
_ ->
- remote_collect(Ref, Type, {error, {node_not_running, Node}}, [], OldSelectFun)
+ Reason = {node_not_running, Node},
+ remote_collect_error(Ref, Type, Reason, OldSelectFun)
end
after 0 ->
Acc
- end;
-remote_collect(Ref, Type, LocalRes = {error, Reason}, _Acc, OldSelectFun) ->
+ end.
+
+remote_collect_error(Ref, Type, Reason, OldSelectFun) ->
receive
{remote_select, Ref, _Node, _RemoteRes} ->
- remote_collect(Ref, Type, LocalRes, [], OldSelectFun)
+ remote_collect_error(Ref, Type, Reason, OldSelectFun)
after 0 ->
- mnesia:abort(Reason)
+ mnesia:abort({error, Reason})
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%