[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 15/34] linux-user: Remove redundant get_errno()
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 15/34] linux-user: Remove redundant get_errno() calls |
Date: |
Thu, 10 Sep 2015 19:50:54 +0100 |
On 6 September 2015 at 00:57, Timothy E Baldwin
<address@hidden> wrote:
> The return value of openat was being translated by get_errno() twice.
> Fixed by removing calls of get_errno() in do_syscall() and keeping those
> in do_openat().
>
> Signed-off-by: Timothy Edward Baldwin <address@hidden>
> ---
> linux-user/syscall.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index c213588..df9b2ca 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5764,17 +5764,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
> arg1,
> case TARGET_NR_open:
> if (!(p = lock_user_string(arg1)))
> goto efault;
> - ret = get_errno(do_openat(cpu_env, AT_FDCWD, p,
> - target_to_host_bitmask(arg2,
> fcntl_flags_tbl),
> - arg3));
> + ret = do_openat(cpu_env, AT_FDCWD, p,
> + target_to_host_bitmask(arg2, fcntl_flags_tbl),
> + arg3);
> unlock_user(p, arg1, 0);
> break;
> case TARGET_NR_openat:
> if (!(p = lock_user_string(arg2)))
> goto efault;
> - ret = get_errno(do_openat(cpu_env, arg1, p,
> - target_to_host_bitmask(arg3,
> fcntl_flags_tbl),
> - arg4));
> + ret = do_openat(cpu_env, arg1, p,
> + target_to_host_bitmask(arg3, fcntl_flags_tbl),
> + arg4);
> unlock_user(p, arg2, 0);
> break;
> case TARGET_NR_close:
Nice catch, but I don't think this patch is sufficient. There are still
code paths in do_openat() which aren't returning a target errno, like
the "mkstemp failed" case. The fake_open->fill functions are also not
generally returning target errnos.
thanks
-- PMM
- [Qemu-devel] [PATCH 04/34] linux-user: Support for restarting system calls for x86 targets, (continued)
- [Qemu-devel] [PATCH 04/34] linux-user: Support for restarting system calls for x86 targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 06/34] linux-user: Support for restarting system calls for MIPS targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 03/34] linux-user: Support for restarting system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 09/34] linux-user: Test for restarting system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 19/34] linux-user: Restart fork() if signals pending, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 15/34] linux-user: Remove redundant get_errno() calls, Timothy E Baldwin, 2015/09/05
- Re: [Qemu-devel] [PATCH 15/34] linux-user: Remove redundant get_errno() calls,
Peter Maydell <=
- [Qemu-devel] [PATCH 17/34] linux-user: Use safe_syscall for wait system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 21/34] linux-user: Remove redundant gdb_queuesig(), Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 10/34] linux-user: Support for restarting system calls for Microblaze targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 07/34] linux-user: Support for restarting system calls for PPC targets, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 14/34] linux-user: Use safe_syscall for read and write system calls, Timothy E Baldwin, 2015/09/05
- [Qemu-devel] [PATCH 16/34] linux-user: Use safe_syscall for open and openat system calls, Timothy E Baldwin, 2015/09/05