OSDN Git Service

linux-user: Use target abi_int type for pipefd[1] in pipe()
authorHelge Deller <deller@gmx.de>
Sun, 17 Jul 2022 16:21:53 +0000 (18:21 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 25 Jul 2022 08:42:11 +0000 (10:42 +0200)
When writing back the fd[1] pipe file handle to emulated userspace
memory, use sizeof(abi_int) as offset insted of the hosts's int type.
There is no functional change in this patch.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <YtQ3Id6z8slpVr7r@p100>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c

index 4f89184..b27a655 100644 (file)
@@ -1615,7 +1615,7 @@ static abi_long do_pipe(CPUArchState *cpu_env, abi_ulong pipedes,
     }
 
     if (put_user_s32(host_pipe[0], pipedes)
-        || put_user_s32(host_pipe[1], pipedes + sizeof(host_pipe[0])))
+        || put_user_s32(host_pipe[1], pipedes + sizeof(abi_int)))
         return -TARGET_EFAULT;
     return get_errno(ret);
 }