diff options
author | Richard Henderson <rth@twiddle.net> | 2010-05-03 10:07:49 -0700 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2010-05-21 16:22:20 +0000 |
commit | 5d2ed42ead9206a998beb780b5502d20b611eb1a (patch) | |
tree | c5e7e751cd285dce8984d797ca74b4b2ee86998f /linux-user | |
parent | 6fd1902fa76e6fd9e9c3975664b0000b00a81526 (diff) | |
download | qemu-5d2ed42ead9206a998beb780b5502d20b611eb1a.tar.gz qemu-5d2ed42ead9206a998beb780b5502d20b611eb1a.tar.bz2 qemu-5d2ed42ead9206a998beb780b5502d20b611eb1a.zip |
alpha-linux-user: Fix brk error return.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/syscall.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ce728faa4d..746967a1f4 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -718,9 +718,17 @@ abi_long do_brk(abi_ulong new_brk) PROT_READ|PROT_WRITE, MAP_ANON|MAP_FIXED|MAP_PRIVATE, 0, 0)); - if (!is_error(mapped_addr)) +#if defined(TARGET_ALPHA) + /* We (partially) emulate OSF/1 on Alpha, which requires we + return a proper errno, not an unchanged brk value. */ + if (is_error(mapped_addr)) { + return -TARGET_ENOMEM; + } +#endif + + if (!is_error(mapped_addr)) { target_brk = new_brk; - + } return target_brk; } |