diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2007-11-02 17:38:48 -0400 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2007-11-03 11:57:00 +0000 |
commit | 77db880c5ac7a05cd8bbb0ffe765e93c9716c130 (patch) | |
tree | a2ba03135802aee4691eef455d8dd532dd60a073 /perlio.c | |
parent | 680ed74dc0c52ab677066ffb3d985dceec0d8bfd (diff) | |
download | perl-77db880c5ac7a05cd8bbb0ffe765e93c9716c130.tar.gz |
Re: building mod_perl-2.0.3 with Perl 5.10.0 (DEVEL32096)
Message-Id: <472BD128.9080105@iki.fi>
PerlIO_teardown is called when there may no longer be an
interpreter available
p4raw-id: //depot/perl@32215
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -2413,7 +2413,7 @@ PerlIO_cleanup(pTHX) } } -void PerlIO_teardown(pTHX) /* Call only from PERL_SYS_TERM(). */ +void PerlIO_teardown() /* Call only from PERL_SYS_TERM(). */ { dVAR; #ifdef DEBUGGING @@ -2421,11 +2421,18 @@ void PerlIO_teardown(pTHX) /* Call only from PERL_SYS_TERM(). */ /* By now all filehandles should have been closed, so any * stray (non-STD-)filehandles indicate *possible* (PerlIO) * errors. */ +#define PERLIO_TEARDOWN_MESSAGE_BUF_SIZE 64 +#define PERLIO_TEARDOWN_MESSAGE_FD 2 + char buf[PERLIO_TEARDOWN_MESSAGE_BUF_SIZE]; int i; for (i = 3; i < PL_perlio_fd_refcnt_size; i++) { - if (PL_perlio_fd_refcnt[i]) - PerlIO_debug("PerlIO_cleanup: fd %d refcnt=%d\n", - i, PL_perlio_fd_refcnt[i]); + if (PL_perlio_fd_refcnt[i]) { + const STRLEN len = + my_snprintf(buf, sizeof(buf), + "PerlIO_teardown: fd %d refcnt=%d\n", + i, PL_perlio_fd_refcnt[i]); + PerlLIO_write(PERLIO_TEARDOWN_MESSAGE_FD, buf, len); + } } } #endif |