]> granicus.if.org Git - strace/commitdiff
alpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 12 Feb 2016 16:37:31 +0000 (16:37 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 13 Feb 2016 00:57:00 +0000 (00:57 +0000)
* net.c (do_pipe) [HAVE_GETRVAL2]: Remove.
Always call decode_pair_fd on exiting.
(SYS_FUNC(pipe)) [HAVE_GETRVAL2]: Call printpair_fd instead of do_pipe.

net.c

diff --git a/net.c b/net.c
index 4ea79d2c57376980c9bafe1a0d09db21ddb01bf9..d79181cef4f991c3c15a279ff7725e3e7fd0844e 100644 (file)
--- a/net.c
+++ b/net.c
@@ -1098,16 +1098,7 @@ static int
 do_pipe(struct tcb *tcp, int flags_arg)
 {
        if (exiting(tcp)) {
-               if (syserror(tcp)) {
-                       printaddr(tcp->u_arg[0]);
-               } else {
-#ifdef HAVE_GETRVAL2
-                       if (flags_arg < 0) {
-                               printpair_fd(tcp, tcp->u_rval, getrval2(tcp));
-                       } else
-#endif
-                               decode_pair_fd(tcp, tcp->u_arg[0]);
-               }
+               decode_pair_fd(tcp, tcp->u_arg[0]);
                if (flags_arg >= 0) {
                        tprints(", ");
                        printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
@@ -1118,7 +1109,13 @@ do_pipe(struct tcb *tcp, int flags_arg)
 
 SYS_FUNC(pipe)
 {
+#ifdef HAVE_GETRVAL2
+       if (exiting(tcp) && !syserror(tcp))
+               printpair_fd(tcp, tcp->u_rval, getrval2(tcp));
+       return 0;
+#else
        return do_pipe(tcp, -1);
+#endif
 }
 
 SYS_FUNC(pipe2)