summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_disk_monitor.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rabbit_disk_monitor.erl b/src/rabbit_disk_monitor.erl
index b1750b61ad..f3a553b438 100644
--- a/src/rabbit_disk_monitor.erl
+++ b/src/rabbit_disk_monitor.erl
@@ -178,8 +178,10 @@ parse_free_unix(CommandResult) ->
parse_free_win32(CommandResult) ->
LastLine = lists:last(string:tokens(CommandResult, "\r\n")),
- [_, _Dir, Free, "bytes", "free"] = string:tokens(LastLine, " "),
- list_to_integer(Free).
+ {ok, Digits} = re:compile("([0-9]+)"),
+ {match,[Free]} =
+ re:run(lists:reverse(LastLine), Digits, [{capture, all_but_first, list}]),
+ list_to_integer(lists:reverse(Free)).
interpret_limit({mem_relative, R}) ->
round(R * vm_memory_monitor:get_total_memory());