From 2556f95e0f4f5e8e95c9766374614ab52edefe3d Mon Sep 17 00:00:00 2001 From: Goro Fuji Date: Mon, 7 Jul 2008 17:04:52 +0900 Subject: Re: [perl #56644] PerlIO resource leaks on open() and then :pop in :unix and :stdio From: "Goro Fuji" Message-ID: p4raw-id: //depot/perl@34775 --- perlio.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'perlio.c') diff --git a/perlio.c b/perlio.c index a3ea344620..436bb85a68 100644 --- a/perlio.c +++ b/perlio.c @@ -2736,9 +2736,14 @@ PerlIOUnix_tell(pTHX_ PerlIO *f) return PerlLIO_lseek(PerlIOSelf(f, PerlIOUnix)->fd, 0, SEEK_CUR); } - IV PerlIOUnix_close(pTHX_ PerlIO *f) +{ + return PerlIOBase_noop_ok(aTHX_ f); +} + +IV +PerlIOUnix_popped(pTHX_ PerlIO *f) { dVAR; const int fd = PerlIOSelf(f, PerlIOUnix)->fd; @@ -2772,7 +2777,7 @@ PERLIO_FUNCS_DECL(PerlIO_unix) = { sizeof(PerlIOUnix), PERLIO_K_RAW, PerlIOUnix_pushed, - PerlIOBase_popped, + PerlIOUnix_popped, PerlIOUnix_open, PerlIOBase_binmode, /* binmode */ NULL, @@ -3121,6 +3126,12 @@ PerlIOStdio_invalidate_fileno(pTHX_ FILE *f) IV PerlIOStdio_close(pTHX_ PerlIO *f) +{ + return PerlIOBase_noop_ok(aTHX_ f); +} + +IV +PerlIOStdio_popped(pTHX_ PerlIO *f) { FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio; if (!stdio) { @@ -3558,7 +3569,7 @@ PERLIO_FUNCS_DECL(PerlIO_stdio) = { sizeof(PerlIOStdio), PERLIO_K_BUFFERED|PERLIO_K_RAW, PerlIOStdio_pushed, - PerlIOBase_popped, + PerlIOStdio_popped, PerlIOStdio_open, PerlIOBase_binmode, /* binmode */ NULL, -- cgit v1.2.1