summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/pp_sys.c b/pp_sys.c
index aba3b14ee4..49122e6db1 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2415,27 +2415,17 @@ PP(pp_sockpair)
const int protocol = POPi;
const int type = POPi;
const int domain = POPi;
- GV * gv1;
- IO * io1;
GV * const gv2 = MUTABLE_GV(POPs);
- IO * const io2 = gv2 ? GvIOn(gv2) : NULL;
- if (!io2)
- report_evil_fh(gv2);
+ IO * const io2 = GvIOn(gv2);
+ GV * const gv1 = MUTABLE_GV(POPs);
+ IO * const io1 = GvIOn(gv1);
- gv1 = MUTABLE_GV(POPs);
- io1 = gv1 ? GvIOn(gv1) : NULL;
- if (!io1)
- report_evil_fh(gv1);
-
- if (io1 && IoIFP(io1))
+ if (IoIFP(io1))
do_close(gv1, FALSE);
- if (io2 && IoIFP(io2))
+ if (IoIFP(io2))
do_close(gv2, FALSE);
- if (!io1 || !io2)
- RETPUSHUNDEF;
-
TAINT_PROPER("socketpair");
if (PerlSock_socketpair(domain, type, protocol, fd) < 0)
RETPUSHUNDEF;