diff mbox

[2/5] linux-user: correct setsockopt() strace.

Message ID 1465417472-11359-3-git-send-email-laurent@vivier.eu (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Vivier June 8, 2016, 8:24 p.m. UTC
From: Laurent Vivier <Laurent@Vivier.EU>

Parameter of SO_RCVTIMEO and SO_SNDTIMEO is timeval, not int.

To test this, you can use :

QEMU_STRACE= ping localhost 2>&1 |grep TIMEO
568 setsockopt(3,SOL_SOCKET,SO_SNDTIMEO,{1,0},8) = 0
568 setsockopt(3,SOL_SOCKET,SO_RCVTIMEO,{1,0},8) = 0

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/strace.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Peter Maydell June 10, 2016, 12:53 p.m. UTC | #1
On 8 June 2016 at 21:24, Laurent Vivier <laurent@vivier.eu> wrote:
> From: Laurent Vivier <Laurent@Vivier.EU>
>
> Parameter of SO_RCVTIMEO and SO_SNDTIMEO is timeval, not int.
>
> To test this, you can use :
>
> QEMU_STRACE= ping localhost 2>&1 |grep TIMEO
> 568 setsockopt(3,SOL_SOCKET,SO_SNDTIMEO,{1,0},8) = 0
> 568 setsockopt(3,SOL_SOCKET,SO_RCVTIMEO,{1,0},8) = 0
>
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  linux-user/strace.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index a7b24e2..398e56e 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -1486,10 +1486,12 @@ print_optint:
>                  goto print_optint;
>              case TARGET_SO_RCVTIMEO:
>                  gemu_log("SO_RCVTIMEO,");
> -                goto print_optint;
> +                print_timeval(optval, 0);
> +                break;
>              case TARGET_SO_SNDTIMEO:
>                  gemu_log("SO_SNDTIMEO,");
> -                goto print_optint;
> +                print_timeval(optval, 0);
> +                break;
>              case TARGET_SO_ATTACH_FILTER: {
>                  struct target_sock_fprog *fprog;

You should just squash this into patch 1.

thanks
-- PMM
diff mbox

Patch

diff --git a/linux-user/strace.c b/linux-user/strace.c
index a7b24e2..398e56e 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1486,10 +1486,12 @@  print_optint:
                 goto print_optint;
             case TARGET_SO_RCVTIMEO:
                 gemu_log("SO_RCVTIMEO,");
-                goto print_optint;
+                print_timeval(optval, 0);
+                break;
             case TARGET_SO_SNDTIMEO:
                 gemu_log("SO_SNDTIMEO,");
-                goto print_optint;
+                print_timeval(optval, 0);
+                break;
             case TARGET_SO_ATTACH_FILTER: {
                 struct target_sock_fprog *fprog;