]> granicus.if.org Git - strace/blobdiff - sock.c
Print kernel_ureg_t and kernel_scno_t using dedicated format strings
[strace] / sock.c
diff --git a/sock.c b/sock.c
index cf13896bd0d3ea0858a2b19827bfb872ea2b8a3e..1af989413d30c2e722ec9606ebaa47cbd48d9412 100644 (file)
--- a/sock.c
+++ b/sock.c
@@ -50,8 +50,8 @@ print_ifname(const char *ifname)
 }
 
 static void
-print_ifreq(struct tcb *tcp, const unsigned int code, const long arg,
-           const struct ifreq *ifr)
+print_ifreq(struct tcb *const tcp, const unsigned int code,
+           const kernel_ureg_t arg, const struct ifreq *const ifr)
 {
        switch (code) {
        case SIOCSIFADDR:
@@ -132,7 +132,7 @@ print_ifc_len(int len)
 }
 
 static int
-decode_ifconf(struct tcb *tcp, const long addr)
+decode_ifconf(struct tcb *const tcp, const kernel_ureg_t addr)
 {
        struct ifconf ifc;
 
@@ -171,7 +171,7 @@ decode_ifconf(struct tcb *tcp, const long addr)
 
        struct ifreq ifra[nifra > max_strlen ? max_strlen : nifra];
        tprints(", ");
-       if (umove_or_printaddr(tcp, (unsigned long) ifc.ifc_buf, &ifra)) {
+       if (umove_or_printaddr(tcp, ptr_to_kulong(ifc.ifc_buf), &ifra)) {
                tprints("}");
                return RVAL_DECODED | 1;
        }
@@ -195,7 +195,7 @@ decode_ifconf(struct tcb *tcp, const long addr)
 }
 
 int
-sock_ioctl(struct tcb *tcp, const unsigned int code, const long arg)
+sock_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ureg_t arg)
 {
        struct ifreq ifr;
 
@@ -207,7 +207,7 @@ sock_ioctl(struct tcb *tcp, const unsigned int code, const long arg)
        case SIOCBRADDBR:
        case SIOCBRDELBR:
                tprints(", ");
-               printstr(tcp, arg, -1);
+               printstr(tcp, arg);
                break;
 #endif