summary refs log tree commit diff stats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2023-08-02 16:17:49 +0900
committerRichard Henderson <richard.henderson@linaro.org>2023-08-06 16:39:00 -0700
commitc6cc059eca18d9f6e4e26bb8b6d1135ddb35d81a (patch)
treeca16a2f002a7bf95bc1a03196abdeb9f03131163 /linux-user/syscall.c
parentddcdd8c48fc48b2d528756fc98f1ce0ec3d7b617 (diff)
downloadfocaccia-qemu-c6cc059eca18d9f6e4e26bb8b6d1135ddb35d81a.tar.gz
focaccia-qemu-c6cc059eca18d9f6e4e26bb8b6d1135ddb35d81a.zip
linux-user: Do not call get_errno() in do_brk()
Later the returned value is compared with -1, and negated errno is not
expected.

Fixes: 00faf08c95 ("linux-user: Don't use MAP_FIXED in do_brk()")
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230802071754.14876-4-akihiko.odaki@daynix.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 95727a816a..b08276bdf8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -862,9 +862,9 @@ abi_long do_brk(abi_ulong brk_val)
      */
     if (new_host_brk_page > brk_page) {
         new_alloc_size = new_host_brk_page - brk_page;
-        mapped_addr = get_errno(target_mmap(brk_page, new_alloc_size,
-                                        PROT_READ|PROT_WRITE,
-                                        MAP_ANON|MAP_PRIVATE, 0, 0));
+        mapped_addr = target_mmap(brk_page, new_alloc_size,
+                                  PROT_READ | PROT_WRITE,
+                                  MAP_ANON | MAP_PRIVATE, -1, 0);
     } else {
         new_alloc_size = 0;
         mapped_addr = brk_page;