From b679508f6ef838a390d807c1bb4696b096543475 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 6 Jul 2015 22:33:39 +0000 Subject: [PATCH] Use printpair_int * evdev.c (repeat_ioctl): Use printpair_int. * net.c (do_pipe, sys_socketpair): Likewise. --- evdev.c | 12 ++++-------- net.c | 25 +++++-------------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/evdev.c b/evdev.c index e06f9c15..f89397e6 100644 --- a/evdev.c +++ b/evdev.c @@ -297,19 +297,15 @@ mtslots_ioctl(struct tcb *tcp, const unsigned int code, long arg) } #endif /* EVIOCGMTSLOTS */ -#ifdef EVIOCGREP +#if defined EVIOCGREP || defined EVIOCSREP static int repeat_ioctl(struct tcb *tcp, long arg) { - unsigned int val[2]; - - if (!verbose(tcp) || umove(tcp, arg, &val) < 0) - return 0; - - tprintf(", [%" PRIu32 " %" PRIu32 "]", val[0], val[1]); + tprints(", "); + printpair_int(tcp, arg, "%u"); return 1; } -#endif /* EVIOCGREP */ +#endif /* EVIOCGREP || EVIOCSREP */ static int evdev_read_ioctl(struct tcb *tcp, const unsigned int code, long arg) diff --git a/net.c b/net.c index c570b7a1..ef9a038c 100644 --- a/net.c +++ b/net.c @@ -955,18 +955,11 @@ do_pipe(struct tcb *tcp, int flags_arg) tprintf("%#lx", tcp->u_arg[0]); } else { #ifdef HAVE_GETRVAL2 - if (flags_arg < 0) { + if (flags_arg < 0) tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp)); - } else + else #endif - { - int fds[2]; - - if (umove(tcp, tcp->u_arg[0], &fds) < 0) - tprintf("%#lx", tcp->u_arg[0]); - else - tprintf("[%u, %u]", fds[0], fds[1]); - } + printpair_int(tcp, tcp->u_arg[0], "%u"); } if (flags_arg >= 0) { tprints(", "); @@ -988,22 +981,14 @@ SYS_FUNC(pipe2) SYS_FUNC(socketpair) { - int fds[2]; - if (entering(tcp)) { printxval(domains, tcp->u_arg[0], "PF_???"); tprints(", "); tprint_sock_type(tcp->u_arg[1]); tprintf(", %lu", tcp->u_arg[2]); } else { - if (syserror(tcp)) { - tprintf(", %#lx", tcp->u_arg[3]); - return 0; - } - if (umoven(tcp, tcp->u_arg[3], sizeof fds, fds) < 0) - tprints(", [...]"); - else - tprintf(", [%u, %u]", fds[0], fds[1]); + tprints(", "); + printpair_int(tcp, tcp->u_arg[3], "%u"); } return 0; } -- 2.40.0