diff options
| author | Tim Watson <tim@rabbitmq.com> | 2012-06-05 12:55:24 +0100 |
|---|---|---|
| committer | Tim Watson <tim@rabbitmq.com> | 2012-06-05 12:55:24 +0100 |
| commit | e5c46d3bf0043fb0c6e8315dbb6c64b6ff9265da (patch) | |
| tree | 0dbc0351c50c5007f100742a15f9dced6709ec1a | |
| parent | fedee05543002b9f2d8a2ed725e3029bff19812a (diff) | |
| download | rabbitmq-server-git-e5c46d3bf0043fb0c6e8315dbb6c64b6ff9265da.tar.gz | |
return the correct value from rabbit_control_main:read_pid_file/2; don't call binary_to_list twice
| -rw-r--r-- | src/rabbit_control_main.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index bce20e8894..3ca3d24df7 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -493,13 +493,13 @@ read_pid_file(PidFile, Wait) -> S = binary_to_list(Bin), Spid = case string:words(S) > 1 of true -> string:sub_word(S, 1); - false -> string:strip(binary_to_list(Bin), right, $\n) + false -> string:strip(S, right, $\n) end, try list_to_integer(Spid) catch error:badarg -> exit({error, {garbage_in_pid_file, PidFile}}) end, - S; + Spid; {{error, enoent}, true} -> timer:sleep(?EXTERNAL_CHECK_INTERVAL), read_pid_file(PidFile, Wait); |
