]> granicus.if.org Git - strace/commitdiff
Use printpair_int
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 6 Jul 2015 22:33:39 +0000 (22:33 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 9 Jul 2015 01:43:44 +0000 (01:43 +0000)
* evdev.c (repeat_ioctl): Use printpair_int.
* net.c (do_pipe, sys_socketpair): Likewise.

evdev.c
net.c

diff --git a/evdev.c b/evdev.c
index e06f9c151e3abb4f0cf79cb10289afe7521e2e8b..f89397e606e1efa2ca92770c92be43924ddf9882 100644 (file)
--- 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 c570b7a1da3c8d856ee1893b2a9d79993eea0a75..ef9a038c83b7bf8e5f0fedd03228b065761aa042 100644 (file)
--- 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;
 }