提交 8384274e 编写于 作者: J Jürg Billeter 提交者: Riku Voipio

linux-user: Do not ignore mmap failure from host

File mapping may fail with EACCES.
Signed-off-by: NJürg Billeter <j@bitron.ch>
Message-id: 1372498892-23676-1-git-send-email-j@bitron.ch
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
上级 f651e6ae
......@@ -483,6 +483,10 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
if (!(flags & MAP_ANONYMOUS)) {
p = mmap(g2h(start), len, prot,
flags | MAP_FIXED, fd, host_offset);
if (p == MAP_FAILED) {
munmap(g2h(start), host_len);
goto fail;
}
host_start += offset - host_offset;
}
start = h2g(host_start);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册