From a70048fb46c7e3634938eaa53e2423567fb07b67 Mon Sep 17 00:00:00 2001 From: Anton Berezin Date: Wed, 17 Oct 2001 20:25:48 +0200 Subject: [PATCH] coredump fix in pp_accept() Message-Id: <20011017182548.A12082@heechee.tobez.org> p4raw-id: //depot/perl@12478 --- pp_sys.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; -- 2.7.4