aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/disk_log_server.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-03-12 09:17:17 +0100
committerHans Bolinder <[email protected]>2014-03-20 16:00:26 +0100
commitce20094582493203c8812cd003e3d3b080f88607 (patch)
tree355a2fed2076173cde6ab1394542f67e17ba8a8a /lib/kernel/src/disk_log_server.erl
parent73af231f1a22083031df49ba19fdfd4f6b434a10 (diff)
downloadotp-ce20094582493203c8812cd003e3d3b080f88607.tar.gz
otp-ce20094582493203c8812cd003e3d3b080f88607.tar.bz2
otp-ce20094582493203c8812cd003e3d3b080f88607.zip
Fix some Dialyzer warnings
Dialyzer recognizes a certain pattern that makes it possible to get rid of 'The created fun has no local return' warnings.
Diffstat (limited to 'lib/kernel/src/disk_log_server.erl')
-rw-r--r--lib/kernel/src/disk_log_server.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/kernel/src/disk_log_server.erl b/lib/kernel/src/disk_log_server.erl
index 684ea5b5db..45334912eb 100644
--- a/lib/kernel/src/disk_log_server.erl
+++ b/lib/kernel/src/disk_log_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2014. 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
@@ -199,7 +199,7 @@ do_open({open, W, #arg{name = Name}=A}=Req, From, State) ->
false when W =:= local ->
case A#arg.distributed of
{true, Nodes} ->
- Fun = fun() -> open_distr_rpc(Nodes, A, From) end,
+ Fun = open_distr_rpc_fun(Nodes, A, From),
_Pid = spawn(Fun),
%% No pending reply is expected, but don't reply yet.
{pending, State};
@@ -225,11 +225,15 @@ do_open({open, W, #arg{name = Name}=A}=Req, From, State) ->
end
end.
+-spec open_distr_rpc_fun([node()], _, _) -> % XXX: underspecified
+ fun(() -> no_return()).
+
+open_distr_rpc_fun(Nodes, A, From) ->
+ fun() -> open_distr_rpc(Nodes, A, From) end.
+
%% Spawning a process is a means to avoid deadlock when
%% disk_log_servers mutually open disk_logs.
--spec open_distr_rpc([node()], _, _) -> no_return(). % XXX: underspecified
-
open_distr_rpc(Nodes, A, From) ->
{AllReplies, BadNodes} = rpc:multicall(Nodes, ?MODULE, dist_open, [A]),
{Ok, Bad} = cr(AllReplies, [], []),