From: Alan Burlison Date: Fri, 28 May 2004 12:27:06 +0000 (+0100) Subject: Remove redundant %SIG assignments from FileCache X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=533968fe05e828818d78b731fade41cae15a5f2a;p=p5sagit%2Fp5-mst-13.2.git Remove redundant %SIG assignments from FileCache Message-ID: <40B7220A.4040305@sun.com> p4raw-id: //depot/perl@22888 --- diff --git a/lib/FileCache.pm b/lib/FileCache.pm index ecf7ed3..2db9cbe 100644 --- a/lib/FileCache.pm +++ b/lib/FileCache.pm @@ -1,6 +1,6 @@ package FileCache; -our $VERSION = 1.04; +our $VERSION = '1.04_01'; =head1 NAME @@ -59,18 +59,21 @@ do not do so if you are calling C from a package other than which it was imported, or with another module which overrides C. If you must, use C. +Although FileCache can be used with piped opens ('-|' or '|-') doing so is +strongly discouraged. If FileCache finds it necessary to close and then reopen +a pipe, the command at the far end of the pipe will be reexecuted - the results +of performing IO on FileCache'd pipes is unlikely to be what you expect. The +ability to use FileCache on pipes may be removed in a future release. + +FileCache does not store the current file offset if it finds it necessary to +close a file. When the file is reopened, the offset will be as specified by the +original C file mode. This could be construed to be a bug. + =head1 BUGS F lies with its C define on some systems, so you may have to set I yourself. -=head1 NOTES - -FileCache installs localized signal handlers for CHLD (a.k.a. CLD) and PIPE -to handle deceased children from 2-arg C with C<'|-'> or C<'-|'> -I. The children would otherwise be reaped eventually, unless you -terminated before repeatedly calling cacheout. - =cut require 5.006; @@ -111,11 +114,6 @@ sub import { # Open in their package. sub cacheout_open { - # Reap our children - local $SIG{CLD} ||= 'IGNORE'if $Config{sig_name} =~ /\bCLD\b/; - local $SIG{CHLD} ||= 'IGNORE'if $Config{sig_name} =~ /\bCHLD\b/; - local $SIG{PIPE} ||= 'IGNORE'if $Config{sig_name} =~ /\bPIPE\b/; - return open(*{caller(1) . '::' . $_[1]}, $_[0], $_[1]) && $_[1]; }