diff options
author | Emile Joubert <emile@rabbitmq.com> | 2013-07-31 12:30:25 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2013-07-31 12:30:25 +0100 |
commit | 2c32f6cdb2c84d1324645423f132214ebf4f1031 (patch) | |
tree | 10ece9e2779f6cd59911518bccdf541a44578599 | |
parent | e2f502dcebfef16beffd6f308d6471d2d47bee4d (diff) | |
download | rabbitmq-server-2c32f6cdb2c84d1324645423f132214ebf4f1031.tar.gz |
Add space for clink os cmds separately
-rw-r--r-- | src/rabbit_control_main.erl | 4 | ||||
-rw-r--r-- | src/rabbit_disk_monitor.erl | 3 | ||||
-rw-r--r-- | src/rabbit_misc.erl | 5 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index c195ace5..4be77f82 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 = os:cmd(rabbit_misc:win32_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 0e2c9ca1..227bbcee 100644 --- a/src/rabbit_disk_monitor.erl +++ b/src/rabbit_disk_monitor.erl @@ -168,7 +168,8 @@ 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 ++ [$"])); + Cmd = "dir /-C /W \"" ++ Dir ++ [$"], + parse_free_win32(os:cmd(rabbit_misc:win32_cmd(Cmd))); get_disk_free(_, Platform) -> {unknown, Platform}. diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index a1e95fd5..672d3b40 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -60,6 +60,7 @@ -export([append_rpc_all_nodes/4]). -export([multi_call/2]). -export([os_cmd/1]). +-export([win32_cmd/1]). -export([gb_sets_difference/2]). -export([version/0, which_applications/0]). -export([sequence_error/1]). @@ -230,6 +231,7 @@ -spec(multi_call/2 :: ([pid()], any()) -> {[{pid(), any()}], [{pid(), any()}]}). -spec(os_cmd/1 :: (string()) -> string()). +-spec(win32_cmd/1 :: (string()) -> string()). -spec(gb_sets_difference/2 :: (gb_set(), gb_set()) -> gb_set()). -spec(version/0 :: () -> string()). -spec(which_applications/0 :: () -> [{atom(), string(), string()}]). @@ -979,6 +981,9 @@ os_cmd(Command) -> _ -> os:cmd(Command) end. +%% Clink workaround: http://code.google.com/p/clink/issues/detail?id=141 +win32_cmd(Command) -> " " ++ Command. + gb_sets_difference(S1, S2) -> gb_sets:fold(fun gb_sets:delete_any/2, S1, S2). |