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 4ea79d2..d79181c 100644
--- a/net.c
+++ b/net.c
@@ -1098,16 +1098,7 @@
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 @@
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)