summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorAnton Berezin <tobez@tobez.org>2001-10-17 20:25:48 +0200
committerAbhijit Menon-Sen <ams@wiw.org>2001-10-17 18:50:55 +0000
commita788c3849cdc557371e8ad787dfe6875cb619731 (patch)
tree833aed4dcd77e6139c6a7ba94b15ef638cf366c3 /pp_sys.c
parent32a4230e51efdc920aa83e3c10aa959a072e0012 (diff)
downloadperl-a788c3849cdc557371e8ad787dfe6875cb619731.tar.gz
coredump fix in pp_accept()
Message-Id: <20011017182548.A12082@heechee.tobez.org> p4raw-id: //depot/perl@12478
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pp_sys.c b/pp_sys.c
index b241a0e931..ae1baa559e 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2464,12 +2464,11 @@ PP(pp_accept)
goto nuts;
nstio = GvIOn(ngv);
- if (IoIFP(nstio))
- do_close(ngv, FALSE);
-
fd = PerlSock_accept(PerlIO_fileno(IoIFP(gstio)), (struct sockaddr *)&saddr, &len);
if (fd < 0)
goto badexit;
+ if (IoIFP(nstio))
+ do_close(ngv, FALSE);
IoIFP(nstio) = PerlIO_fdopen(fd, "r");
IoOFP(nstio) = PerlIO_fdopen(fd, "w");
IoTYPE(nstio) = IoTYPE_SOCKET;