diff options
| author | Tim Watson <tim@rabbitmq.com> | 2012-06-06 15:51:21 +0100 |
|---|---|---|
| committer | Tim Watson <tim@rabbitmq.com> | 2012-06-06 15:51:21 +0100 |
| commit | 82db4cf2abe4bb4b0b6e9a48ace2e4c38b4e5fbc (patch) | |
| tree | 6d402cf5e83c1dcd73fb831682e26c3bf807f2e1 /src | |
| parent | 63ec0f32f0b41eca1432b885ed697f60a61b802e (diff) | |
| download | rabbitmq-server-git-82db4cf2abe4bb4b0b6e9a48ace2e4c38b4e5fbc.tar.gz | |
simply reading pid files in a way that works on R12B
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_control_main.erl | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index a36fe90c8c..2e163cfbe1 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -491,10 +491,8 @@ read_pid_file(PidFile, Wait) -> case {file:read_file(PidFile), Wait} of {{ok, Bin}, _} -> S = binary_to_list(Bin), - PidS = case string:words(S) > 1 of - true -> string:sub_word(S, 1); - false -> string:strip(S, right, $\n) - end, + {match, [PidS]} = re:run(S, "[^\\s]+", + [{capture, all, list}]), try list_to_integer(PidS) catch error:badarg -> exit({error, {garbage_in_pid_file, PidFile}}) |
