提交 1add8698 编写于 作者: J Juan Quintela 提交者: Riku Voipio

syscall: really return ret code

We assign ret with the error code, but then return 0 unconditionally.
Signed-off-by: NJuan Quintela <quintela@redhat.com>
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
上级 331c23b5
......@@ -3799,10 +3799,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:
......@@ -3821,13 +3821,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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册