]> xenbits.xensource.com Git - qemu-xen-unstable.git/commitdiff
linux-user: fix socket() strace
authorLaurent Vivier <laurent@vivier.eu>
Thu, 12 Mar 2020 16:55:30 +0000 (17:55 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Fri, 20 Mar 2020 14:51:54 +0000 (15:51 +0100)
print_socket_type() doesn't manage flags and the correct type cannot
be displayed

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200312165530.53450-1-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/strace.c

index 4f7130b2ff630c82751393673583982ed21883b2..69232f7e27b8cf7ee20ac2c6c1aa23df5ceb0abd 100644 (file)
@@ -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