qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 08/16] linux-user: respect timezone for setti


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 08/16] linux-user: respect timezone for settimeofday
Date: Sun, 22 Jun 2014 00:18:02 +0100

On 21 June 2014 23:53, Paul Burton <address@hidden> wrote:
> The settimeofday syscall accepts a tz argument indicating the desired
> timezone to the kernel. QEMU previously ignored any argument provided
> by the target program & always passed NULL to the kernel. Instead,
> translate the argument & pass along the data userland provided.
>
> Although this argument is described by the settimeofday man page as
> obsolete, it is used by systemd as of version 213.
>
> Signed-off-by: Paul Burton <address@hidden>
> ---
> Changes in v2:
>   - None.
> ---
>  linux-user/syscall.c      | 27 ++++++++++++++++++++++++++-
>  linux-user/syscall_defs.h |  5 +++++
>  2 files changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 3861f0f..ef04dc6 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -933,6 +933,22 @@ static inline abi_long copy_to_user_timeval(abi_ulong 
> target_tv_addr,
>      return 0;
>  }
>
> +static inline abi_long copy_from_user_timezone(struct timezone *tz,
> +                                               abi_ulong target_tz_addr)
> +{
> +    struct target_timezone *target_tz;
> +
> +    if (!lock_user_struct(VERIFY_READ, target_tz, target_tz_addr, 1))
> +        return -TARGET_EFAULT;

Coding style mandates braces even on single-line if()s; checkpatch.pl
will catch this usually.

Code looks OK otherwise.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]