develooper Front page | perl.perl5.porters | Postings from May 2004

Re: FileCache 1.03 (as per 5.8.3) breaks system()

Thread Previous | Thread Next
From:
Alan Burlison
Date:
May 24, 2004 03:53
Subject:
Re: FileCache 1.03 (as per 5.8.3) breaks system()
Message ID:
40B1D409.9090109@sun.com
Jerrad Pierce wrote:

> Okay, the fixed packagae is at ftp://pthbb.org/pub/pm/FileCache/1.04.tgz
:
:
> -    # Reap our children
> -    ${"$pkg\::SIG"}{'CLD'}  = 'IGNORE' if $Config{sig_name} =~ /\bCLD\b/;
> -    ${"$pkg\::SIG"}{'CHLD'} = 'IGNORE' if $Config{sig_name} =~ /\bCHLD\b/;
> -    ${"$pkg\::SIG"}{'PIPE'} = 'IGNORE' if $Config{sig_name} =~ /\bPIPE\b/;
> -
>      # Truth is okay here because setting maxopen to 0 would be bad
>      return $cacheout_maxopen = $args{maxopen} if $args{maxopen};
>      foreach my $param ( '/usr/include/sys/param.h' ){
> @@ -113,6 +111,11 @@
>  
>  # Open in their package.
>  sub cacheout_open {
> +  # Reap our children
> +  local $SIG{CLD}  ||= 'IGNORE'if $Config{sig_name} =~ /\bCHLD\b/;
> +  local $SIG{CHLD} ||= 'IGNORE'if $Config{sig_name} =~ /\bCLD\b/;
> +  local $SIG{PIPE} ||= 'IGNORE'if $Config{sig_name} =~ /\bPIPE\b/;
> +
>    return open(*{caller(1) . '::' . $_[1]}, $_[0], $_[1]) && $_[1];
>  }
>  
> =end

Umm, what exactly are the local $SIG{... lines supposed to do?  The 
signals will only be ignored until the end of cacheout_open, then 
they'll revert to the old values.  As a SIGPIPE will be more likely to 
happen at some distant point in the future, what is the point of 
changing the signal disposition to IGNORE for just the open() call?

-- 
Alan Burlison
--


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About