From: Dmitry V. Levin Date: Fri, 12 Feb 2016 16:37:31 +0000 (+0000) Subject: alpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall X-Git-Tag: v4.12~563 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b388858035455e120f5d13b1707a96e77ca621a;p=strace alpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall * 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. --- diff --git a/net.c b/net.c index 4ea79d2c..d79181ce 100644 --- 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)