# :perlio -> ok
# :crlf -> ok
-foreach my $layer(qw(:unix :stdio :perlio :crlf)){
- my $base_fd = do{ open my $in, '<', $0 or die $!; fileno $in };
+TODO: {
+ local $TODO = "[perl #56644] PerlIO resource leaks on open() and then :pop in :unix and :stdio";
+ foreach my $layer(qw(:unix :stdio :perlio :crlf)){
+ my $base_fd = do{ open my $in, '<', $0 or die $!; fileno $in };
- for(1 .. 3){
- open my $fh, "<$layer", $0 or die $!;
+ for(1 .. 3){
+ open my $fh, "<$layer", $0 or die $!;
- is fileno($fh), $base_fd, $layer;
- binmode $fh, ':pop';
- }
+ is fileno($fh), $base_fd, $layer;
+ binmode $fh, ':pop';
+ }
+ }
}
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)
+PerlIOUnix_close(pTHX_ PerlIO *f)
{
dVAR;
const int fd = PerlIOSelf(f, PerlIOUnix)->fd;
sizeof(PerlIOUnix),
PERLIO_K_RAW,
PerlIOUnix_pushed,
- PerlIOUnix_popped,
+ PerlIOBase_popped,
PerlIOUnix_open,
PerlIOBase_binmode, /* binmode */
NULL,
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) {
errno = EBADF;
sizeof(PerlIOStdio),
PERLIO_K_BUFFERED|PERLIO_K_RAW,
PerlIOStdio_pushed,
- PerlIOStdio_popped,
+ PerlIOBase_popped,
PerlIOStdio_open,
PerlIOBase_binmode, /* binmode */
NULL,