]> granicus.if.org Git - strace/commitdiff
process_vm: remove syserror check for iovec printing
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 14 Oct 2016 23:57:47 +0000 (02:57 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 28 Oct 2016 18:40:11 +0000 (18:40 +0000)
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.

process_vm.c

index 0a9dcd21de1e3d34a4a78e8e19f40c57d8f34a38..a61713ae31ff29dea1a3652ebf12787fd30cc732 100644 (file)
@@ -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]);