diff options
| author | Tim Watson <tim@rabbitmq.com> | 2012-06-01 16:07:30 +0100 |
|---|---|---|
| committer | Tim Watson <tim@rabbitmq.com> | 2012-06-01 16:07:30 +0100 |
| commit | 98ac91d73af6149694635523539cb5adf81b4472 (patch) | |
| tree | bd0cd379d9473ba6fd8fec5e7b7bae59c9acef12 /src | |
| parent | f92f3fea63d90128af7688223195b04dc7f4086b (diff) | |
| parent | 604ed10881dadd53fbf6ed05f9633b1027dff50e (diff) | |
| download | rabbitmq-server-git-98ac91d73af6149694635523539cb5adf81b4472.tar.gz | |
merge tip
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_control_main.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index f8b8c345eb..294080064c 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -490,8 +490,12 @@ wait_for_process_death(Pid) -> read_pid_file(PidFile, Wait) -> case {file:read_file(PidFile), Wait} of {{ok, Bin}, _} -> - S = re:replace(Bin, "\\s", "", [global, {return, list}]), - try list_to_integer(S) + 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) + end, + try list_to_integer(Spid) catch error:badarg -> exit({error, {garbage_in_pid_file, PidFile}}) end, |
