[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/8] syscall: really return ret code
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH 2/8] syscall: really return ret code |
Date: |
Thu, 16 Jun 2011 17:37:09 +0100 |
From: Juan Quintela <address@hidden>
We assign ret with the error code, but then return 0 unconditionally.
Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
linux-user/syscall.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5cb27c7..f3d03b0 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3751,10 +3751,10 @@ static abi_long do_get_thread_area(CPUX86State *env,
abi_ulong ptr)
#ifndef TARGET_ABI32
static abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
{
- abi_long ret;
+ abi_long ret = 0;
abi_ulong val;
int idx;
-
+
switch(code) {
case TARGET_ARCH_SET_GS:
case TARGET_ARCH_SET_FS:
@@ -3773,13 +3773,13 @@ static abi_long do_arch_prctl(CPUX86State *env, int
code, abi_ulong addr)
idx = R_FS;
val = env->segs[idx].base;
if (put_user(val, addr, abi_ulong))
- return -TARGET_EFAULT;
+ ret = -TARGET_EFAULT;
break;
default:
ret = -TARGET_EINVAL;
break;
}
- return 0;
+ return ret;
}
#endif
--
1.7.1
- [Qemu-devel] [PATCH 0/8] linux-user: Fix gcc 4.6 compile warnings, Peter Maydell, 2011/06/16
- [Qemu-devel] [PATCH 5/8] flatload: memp was a write-only variable, Peter Maydell, 2011/06/16
- [Qemu-devel] [PATCH 1/8] linuxload: id_change was a write only variable, Peter Maydell, 2011/06/16
- [Qemu-devel] [PATCH 3/8] linux-user: syscall should use sanitized arg1, Peter Maydell, 2011/06/16
- [Qemu-devel] [PATCH 8/8] linux-user/signal.c: Remove unused fenab, Peter Maydell, 2011/06/16
- [Qemu-devel] [PATCH 4/8] flatload: end_code was only used in a debug message, Peter Maydell, 2011/06/16
- [Qemu-devel] [PATCH 6/8] linux-user: Bump do_syscall() up to 8 syscall arguments, Peter Maydell, 2011/06/16
- [Qemu-devel] [PATCH 2/8] syscall: really return ret code,
Peter Maydell <=
- [Qemu-devel] [PATCH 7/8] linux-user/signal.c: Remove only-ever-set variable fpu_save_addr, Peter Maydell, 2011/06/16