From 7dd46c02e4b83be7fbabe81465137d7116b6add6 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 3 May 2010 10:07:49 -0700 Subject: [PATCH] alpha-linux-user: Fix brk error return. Signed-off-by: Richard Henderson Signed-off-by: Aurelien Jarno --- linux-user/syscall.c | 12 ++++++++++-- 1 file 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; } -- 2.11.4.GIT