Handle `eacces` errors in addition to `eperm` in `hipe_compile` command

`hipe_compile` command validation checks that directory can be created and
have permissions to write .beam files. System can return `eperm` or `eacces`
errors in different conditions, but the meaning of those errors is same.
This commit is contained in:
Daniil Fedotov 2017-03-14 17:18:18 +00:00
parent 950a56de4c
commit 05a2a18f52
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.HipeCompileCommand do
false ->
case File.mkdir_p(target_dir) do
:ok -> :ok
{:error, :eperm} ->
{:error, perm} when perm == :eperm or perm == :eacces ->
{:error, {:bad_argument, "Cannot create target directory #{target_dir}: insufficient permissions"}}
end
end