diff options
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r-- | linux-user/syscall.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b1dc365e6e..3946d61b67 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -420,7 +420,7 @@ abi_long do_brk(abi_ulong new_brk) if (!new_brk) return target_brk; if (new_brk < target_original_brk) - return -TARGET_ENOMEM; + return target_brk; brk_page = HOST_PAGE_ALIGN(target_brk); @@ -435,12 +435,11 @@ abi_long do_brk(abi_ulong new_brk) mapped_addr = get_errno(target_mmap(brk_page, new_alloc_size, PROT_READ|PROT_WRITE, MAP_ANON|MAP_FIXED|MAP_PRIVATE, 0, 0)); - if (is_error(mapped_addr)) { - return mapped_addr; - } else { + + if (!is_error(mapped_addr)) target_brk = new_brk; - return target_brk; - } + + return target_brk; } static inline abi_long copy_from_user_fdset(fd_set *fds, |