diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-03-30 14:06:52 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-03-30 14:06:52 +0100 |
| commit | d071751fc4498d3ac69abe78af00d9703bb5dbc8 (patch) | |
| tree | 4a7a1baab6bb7ede6bef7ec7282634391c77d183 | |
| parent | 197b263d384d5344ea03feacd29b2430da807d5a (diff) | |
| download | rabbitmq-server-git-d071751fc4498d3ac69abe78af00d9703bb5dbc8.tar.gz | |
Make sure Attempts does not go negative.
| -rw-r--r-- | src/rabbit_control.erl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index 6fb465b514..1af91f4c3a 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -304,10 +304,9 @@ action(list_permissions, Node, [], Opts, Inform) -> wait_for_application(Node, Attempts) -> case rpc_call(Node, application, which_applications, [infinity]) of - {badrpc, _} = E -> NewAttempts = Attempts - 1, - case NewAttempts of + {badrpc, _} = E -> case Attempts of 0 -> E; - _ -> wait_for_application0(Node, NewAttempts) + _ -> wait_for_application0(Node, Attempts - 1) end; Apps -> case proplists:is_defined(rabbit, Apps) of %% We've seen the node up; if it goes down |
