]> granicus.if.org Git - strace/commitdiff
net: fix printing of struct linger's field names
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 8 Jul 2017 14:57:44 +0000 (14:57 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 8 Jul 2017 14:57:44 +0000 (14:57 +0000)
* net.c: Include "print_fields.h".
(print_linger): Print fields of struct linger using PRINT_FIELD_D.

net.c

diff --git a/net.c b/net.c
index 807eb2509b35ee85fb198d86cd9e0de1c2099220..273edda0599f3941ddb3baa3d5436e4c8a0dc554 100644 (file)
--- a/net.c
+++ b/net.c
@@ -30,6 +30,8 @@
  */
 
 #include "defs.h"
+#include "print_fields.h"
+
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
@@ -497,9 +499,9 @@ print_linger(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
                return;
        }
 
-       tprintf("{onoff=%d, linger=%d}",
-               linger.l_onoff,
-               linger.l_linger);
+       PRINT_FIELD_D("{", linger, l_onoff);
+       PRINT_FIELD_D(", ", linger, l_linger);
+       tprints("}");
 }
 
 #ifdef SO_PEERCRED