Patchwork linux-user: correct print_timeval() swap tv_sec and tv_usec

login
register
mail settings
Submitter Laurent Vivier
Date Dec. 31, 2012, 7:45 p.m.
Message ID <1356983106-12644-1-git-send-email-laurent@vivier.eu>
Download mbox | patch
Permalink /patch/208893/
State New
Headers show

Comments

Laurent Vivier - Dec. 31, 2012, 7:45 p.m.
From: Laurent Vivier <Laurent@Vivier.EU>

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
 linux-user/strace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Laurent Vivier - Jan. 26, 2013, 11:24 a.m.
ping

Le lundi 31 décembre 2012 à 20:45 +0100, Laurent Vivier a écrit :
> From: Laurent Vivier <Laurent@Vivier.EU>
> 
> Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
> ---
>  linux-user/strace.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index 6ec90e8..4e91a6e 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -682,7 +682,7 @@ print_timeval(abi_ulong tv_addr, int last)
>          if (!tv)
>              return;
>          gemu_log("{" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "}%s",
> -            tv->tv_sec, tv->tv_usec, get_comma(last));
> +            tswapal(tv->tv_sec), tswapal(tv->tv_usec), get_comma(last));
>          unlock_user(tv, tv_addr, 0);
>      } else
>          gemu_log("NULL%s", get_comma(last));
Peter Maydell - Jan. 26, 2013, 11:46 a.m.
On 31 December 2012 19:45, Laurent Vivier <laurent@vivier.eu> wrote:
> From: Laurent Vivier <Laurent@Vivier.EU>
>
> Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM

Patch

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 6ec90e8..4e91a6e 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -682,7 +682,7 @@  print_timeval(abi_ulong tv_addr, int last)
         if (!tv)
             return;
         gemu_log("{" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "}%s",
-            tv->tv_sec, tv->tv_usec, get_comma(last));
+            tswapal(tv->tv_sec), tswapal(tv->tv_usec), get_comma(last));
         unlock_user(tv, tv_addr, 0);
     } else
         gemu_log("NULL%s", get_comma(last));