[Catalyst] Re: System call problem
Bill Moseley
moseley at hank.org
Wed Dec 24 15:30:48 GMT 2008
On Wed, Dec 24, 2008 at 02:41:31PM +0100, Florent Angly wrote:
> I must say that I don't fully appreciate the differences between the
> different child signal methods. I'm happy with using 'DEFAULT'.
> The easiest way to reproduce this behavior is to run these commands:
> perl -e '$SIG{CHLD} = 'IGNORE'; print system('echo')."\n";'
> Returns:
> -1
> Whereas:
> perl -e '$SIG{CHLD} = 'DEFAULT'; print system('echo')."\n";'
> Returns:
> 0
If you ignore SIGCHLD then there's nothing to wait for.
$ perl -le 'wait(); print "$! Exit code: $?\n"'
No child processes Exit code: -1
$ perl -le '$SIG{CHLD}="IGNORE"; print "Ret: " . system("true") . " Err $!\n"'
Ret: -1 Err No child processes
in Engine::HTTP there's:
my $restart = 0;
local $SIG{CHLD} = 'IGNORE';
my $allowed = $options->{allowed} || { '127.0.0.1' => '255.255.255.255' };
my $addr = $host ? inet_aton($host) : INADDR_ANY;
if ( $addr eq INADDR_ANY ) {
require Sys::Hostname;
$host = lc Sys::Hostname::hostname();
}
else {
$host = gethostbyaddr( $addr, AF_INET ) || inet_ntoa($addr);
}
Is that IGNORE for calling `hostname`? Or for the later fork()?
And if it's for the late fork() why IGNORE over wait?
I guess there's svn blame, but I find in general the Catalyst source
could use much more commenting to show intent of the developer.
--
Bill Moseley
moseley at hank.org
Sent from my iMutt
More information about the Catalyst
mailing list