Explorar el Código

strace: Show sun_path on AF_UNIX socket addresses

Rodrigo Tobar hace 3 años
padre
commit
6ff56a96bd
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      Userland/Utilities/strace.cpp

+ 5 - 0
Userland/Utilities/strace.cpp

@@ -518,6 +518,11 @@ struct Formatter<struct sockaddr> : StandardFormatter {
                 ", sin_port={}, sin_addr={}",
                 address_in->sin_port,
                 IPv4Address(address_in->sin_addr.s_addr).to_string());
+        } else if (address.sa_family == AF_UNIX) {
+            auto* address_un = (const struct sockaddr_un*)&address;
+            builder.appendff(
+                ", sun_path={}",
+                address_un->sun_path);
         }
         builder.append('}');
     }