From: Eugene Syromyatnikov Date: Fri, 14 Oct 2016 23:57:47 +0000 (+0300) Subject: process_vm: remove syserror check for iovec printing X-Git-Tag: v4.15~206 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44ffbf0adc37a04c9644913bd67b63f56142558b;p=strace process_vm: remove syserror check for iovec printing This check had been done by print_array inside tprint_iov anyway. * process_vm.c (SYS_FUNC(process_vm_readv)): Use tprint_iov_upto for printing local_iov; do not check for syserror, provide decode_iov parameter to tprint_iov{,_upto} based on its value instead. --- diff --git a/process_vm.c b/process_vm.c index 0a9dcd21..a61713ae 100644 --- a/process_vm.c +++ b/process_vm.c @@ -35,21 +35,14 @@ SYS_FUNC(process_vm_readv) tprintf("%ld, ", tcp->u_arg[0]); } else { /* arg 2: local iov */ - if (syserror(tcp)) { - printaddr(tcp->u_arg[1]); - } else { - tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], - IOV_DECODE_STR); - } + tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], + syserror(tcp) ? IOV_DECODE_ADDR : IOV_DECODE_STR, + tcp->u_rval); /* arg 3: local iovcnt */ tprintf(", %lu, ", tcp->u_arg[2]); /* arg 4: remote iov */ - if (syserror(tcp)) { - printaddr(tcp->u_arg[3]); - } else { - tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], - IOV_DECODE_ADDR); - } + tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], + IOV_DECODE_ADDR); /* arg 5: remote iovcnt */ /* arg 6: flags */ tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]);