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_???");
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)