diff options
| author | Tim Watson <tim@rabbitmq.com> | 2012-06-01 16:03:12 +0100 |
|---|---|---|
| committer | Tim Watson <tim@rabbitmq.com> | 2012-06-01 16:03:12 +0100 |
| commit | 604ed10881dadd53fbf6ed05f9633b1027dff50e (patch) | |
| tree | 064e061849323d05baf266834af2216c20376c90 /src | |
| parent | 370dc9583665107e4433fba90e749cd66148c353 (diff) | |
| download | rabbitmq-server-git-604ed10881dadd53fbf6ed05f9633b1027dff50e.tar.gz | |
don't use re:replace/3 as it's unavailable on R12
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, |
