]> granicus.if.org Git - strace/commitdiff
Fix simultaneous -e read and -e write usage
authorAurelien Jacobs <aurel@gnuage.org>
Sat, 31 Jan 2015 22:57:00 +0000 (23:57 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 1 Feb 2015 01:33:17 +0000 (01:33 +0000)
This allows using both -e read=FD and -e write=FD at the same time
with the same FD.
Without this patch, the -e write=FD is ignored if -e read=FD is used
at the same time.

Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
syscall.c

index 51771c24aac6f87985f6a7c6e6d62fd485f65e09..dfeef77cb6bcadc544acea14cc7bb0188c75a018 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -2494,17 +2494,21 @@ dumpio(struct tcb *tcp)
                if (func == sys_read ||
                    func == sys_pread ||
                    func == sys_recv ||
-                   func == sys_recvfrom)
+                   func == sys_recvfrom) {
                        dumpstr(tcp, tcp->u_arg[1], tcp->u_rval);
-               else if (func == sys_readv)
+                       return;
+               } else if (func == sys_readv) {
                        dumpiov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+                       return;
 #if HAVE_SENDMSG
-               else if (func == sys_recvmsg)
+               } else if (func == sys_recvmsg) {
                        dumpiov_in_msghdr(tcp, tcp->u_arg[1]);
-               else if (func == sys_recvmmsg)
+                       return;
+               } else if (func == sys_recvmmsg) {
                        dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]);
+                       return;
 #endif
-               return;
+               }
        }
        if (qual_flags[tcp->u_arg[0]] & QUAL_WRITE) {
                if (func == sys_write ||
@@ -2520,7 +2524,6 @@ dumpio(struct tcb *tcp)
                else if (func == sys_sendmmsg)
                        dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]);
 #endif
-               return;
        }
 }