aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-02-22 13:24:42 +0100
committerHans Bolinder <[email protected]>2016-02-22 13:24:42 +0100
commitb8cd565e69ee2affbfeee3a9d924265b9222edb9 (patch)
tree404043a232715984296b5550ff8620d15924a910 /lib/mnesia
parent2c370def9ddbc34efb16f5dbe8064350c140183a (diff)
parent8c5f8128fc167d67fbd5d63205f35eade4cc741f (diff)
downloadotp-b8cd565e69ee2affbfeee3a9d924265b9222edb9.tar.gz
otp-b8cd565e69ee2affbfeee3a9d924265b9222edb9.tar.bz2
otp-b8cd565e69ee2affbfeee3a9d924265b9222edb9.zip
Merge branch 'maint'
* maint: Fix a few dialyzer warnings
Diffstat (limited to 'lib/mnesia')
-rw-r--r--lib/mnesia/src/mnesia_bup.erl8
-rw-r--r--lib/mnesia/src/mnesia_lib.erl3
-rw-r--r--lib/mnesia/src/mnesia_log.erl8
3 files changed, 14 insertions, 5 deletions
diff --git a/lib/mnesia/src/mnesia_bup.erl b/lib/mnesia/src/mnesia_bup.erl
index 1f150ae38b..8b1143a352 100644
--- a/lib/mnesia/src/mnesia_bup.erl
+++ b/lib/mnesia/src/mnesia_bup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -112,7 +112,7 @@ iter(R, Header, Schema, Fun, Acc, BupItems) ->
safe_apply(R, write, [_, Items]) when Items =:= [] ->
R;
safe_apply(R, What, Args) ->
- Abort = fun(Re) -> abort_restore(R, What, Args, Re) end,
+ Abort = abort_restore_fun(R, What, Args),
Mod = R#restore.bup_module,
try apply(Mod, What, Args) of
{ok, Opaque, Items} when What =:= read ->
@@ -127,6 +127,10 @@ safe_apply(R, What, Args) ->
Abort(Re)
end.
+-spec abort_restore_fun(_, _, _) -> fun((_) -> no_return()).
+abort_restore_fun(R, What, Args) ->
+ fun(Re) -> abort_restore(R, What, Args, Re) end.
+
abort_restore(R = #restore{bup_module=Mod}, What, Args, Reason) ->
dbg_out("Restore aborted. ~p:~p~p -> ~p~n",
[Mod, What, Args, Reason]),
diff --git a/lib/mnesia/src/mnesia_lib.erl b/lib/mnesia/src/mnesia_lib.erl
index 4e761d2bed..a5eded4f0f 100644
--- a/lib/mnesia/src/mnesia_lib.erl
+++ b/lib/mnesia/src/mnesia_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -403,6 +403,7 @@ other_val_1(Var) ->
_ -> error
end.
+-spec pr_other(_) -> no_return().
pr_other(Var) ->
Why =
case is_running() of
diff --git a/lib/mnesia/src/mnesia_log.erl b/lib/mnesia/src/mnesia_log.erl
index 8b19e13ff6..36135418c8 100644
--- a/lib/mnesia/src/mnesia_log.erl
+++ b/lib/mnesia/src/mnesia_log.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -734,7 +734,7 @@ backup_schema(B, Tabs) ->
safe_apply(B, write, [_, Items]) when Items == [] ->
B;
safe_apply(B, What, Args) ->
- Abort = fun(R) -> abort_write(B, What, Args, R) end,
+ Abort = abort_write_fun(B, What, Args),
receive
{'EXIT', Pid, R} -> Abort({'EXIT', Pid, R})
after 0 ->
@@ -746,6 +746,10 @@ safe_apply(B, What, Args) ->
end
end.
+-spec abort_write_fun(_, _, _) -> fun((_) -> no_return()).
+abort_write_fun(B, What, Args) ->
+ fun(R) -> abort_write(B, What, Args, R) end.
+
abort_write(B, What, Args, Reason) ->
Mod = B#backup_args.module,
Opaque = B#backup_args.opaque,