qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2] linux-user: fix socket() strace


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2] linux-user: fix socket() strace
Date: Thu, 12 Mar 2020 21:31:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 3/12/20 5:55 PM, Laurent Vivier wrote:
print_socket_type() doesn't manage flags and the correct type cannot
be displayed

Signed-off-by: Laurent Vivier <address@hidden>
---

Notes:
     v2: replace gemu_log() by qemu_log() as it has been removed from qemu

  linux-user/strace.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 4f7130b2ff63..69232f7e27b8 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -444,7 +444,7 @@ print_socket_domain(int domain)
  static void
  print_socket_type(int type)
  {
-    switch (type) {
+    switch (type & TARGET_SOCK_TYPE_MASK) {
      case TARGET_SOCK_DGRAM:
          qemu_log("SOCK_DGRAM");
          break;
@@ -464,6 +464,12 @@ print_socket_type(int type)
          qemu_log("SOCK_PACKET");
          break;
      }
+    if (type & TARGET_SOCK_CLOEXEC) {
+        qemu_log("|SOCK_CLOEXEC");
+    }
+    if (type & TARGET_SOCK_NONBLOCK) {
+        qemu_log("|SOCK_NONBLOCK");
+    }
  }
static void


Reviewed-by: Philippe Mathieu-Daudé <address@hidden>




reply via email to

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