summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-07-31 17:11:51 +0100
committerSimon MacMullen <simon@rabbitmq.com>2013-07-31 17:11:51 +0100
commitfaa7719708d5dcc1e7015c86a65d0607f63eb2a9 (patch)
tree6f34f75d4c01dcfdc1cc8007c436601624bfca11
parent2aa0f8ba052507bd0d9a12d72497f6c089d1c41a (diff)
parentb5e877790f7d332b3f09e9b3b1e3c64b102fcd44 (diff)
downloadrabbitmq-server-faa7719708d5dcc1e7015c86a65d0607f63eb2a9.tar.gz
stable to default
-rw-r--r--src/rabbit_control_main.erl4
-rw-r--r--src/rabbit_disk_monitor.erl2
-rw-r--r--src/rabbit_misc.erl16
3 files changed, 15 insertions, 7 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl
index abc216c0..0b666a36 100644
--- a/src/rabbit_control_main.erl
+++ b/src/rabbit_control_main.erl
@@ -602,8 +602,8 @@ process_up(Pid) ->
run_ps(Pid) =:= 0
end},
{win32, fun () ->
- Res = os:cmd("tasklist /nh /fi \"pid eq " ++
- Pid ++ "\" 2>&1"),
+ Cmd = "tasklist /nh /fi \"pid eq " ++ Pid ++ "\" ",
+ Res = rabbit_misc:os_cmd(Cmd ++ "2>&1"),
case re:run(Res, "erl\\.exe", [{capture, none}]) of
match -> true;
_ -> false
diff --git a/src/rabbit_disk_monitor.erl b/src/rabbit_disk_monitor.erl
index 29665747..5aaa1b2d 100644
--- a/src/rabbit_disk_monitor.erl
+++ b/src/rabbit_disk_monitor.erl
@@ -168,7 +168,7 @@ get_disk_free(Dir, {unix, Sun})
get_disk_free(Dir, {unix, _}) ->
parse_free_unix(rabbit_misc:os_cmd("/bin/df -kP " ++ Dir));
get_disk_free(Dir, {win32, _}) ->
- parse_free_win32(os:cmd("dir /-C /W \"" ++ Dir ++ [$"]));
+ parse_free_win32(rabbit_misc:os_cmd("dir /-C /W \"" ++ Dir ++ [$"]));
get_disk_free(_, Platform) ->
{unknown, Platform}.
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 3df13876..8d8cb07c 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -973,10 +973,18 @@ receive_multi_call([{Mref, Pid} | MonitorPids], Good, Bad) ->
end.
os_cmd(Command) ->
- Exec = hd(string:tokens(Command, " ")),
- case os:find_executable(Exec) of
- false -> throw({command_not_found, Exec});
- _ -> os:cmd(Command)
+ case os:type() of
+ {win32, _} ->
+ %% Clink workaround; see
+ %% http://code.google.com/p/clink/issues/detail?id=141
+ os:cmd(" " + Command);
+ _ ->
+ %% Don't just return "/bin/sh: <cmd>: not found" if not found
+ Exec = hd(string:tokens(Command, " ")),
+ case os:find_executable(Exec) of
+ false -> throw({command_not_found, Exec});
+ _ -> os:cmd(Command)
+ end
end.
gb_sets_difference(S1, S2) ->