From: Anton Berezin Date: Wed, 17 Oct 2001 18:25:48 +0000 (+0200) Subject: coredump fix in pp_accept() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a70048fb46c7e3634938eaa53e2423567fb07b67;p=p5sagit%2Fp5-mst-13.2.git coredump fix in pp_accept() Message-Id: <20011017182548.A12082@heechee.tobez.org> p4raw-id: //depot/perl@12478 --- diff --git a/pp_sys.c b/pp_sys.c index b241a0e..ae1baa5 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;