perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: IPC::Run3, SIGINT, and system()
Date Wed, 01 Oct 2003 21:19:01 GMT
Barrie Slaymaker wrote:
> On Wed, 2003-10-01 at 14:09, Stas Bekman wrote:
>>And it doesn't seem to do the right thing. It aborts the child process, but 
>>leaves the parent running as if it didn't receive SIGINT, causing a false 
>>failure reports.
> Not sure why; IPC::Run uses system() to spawn the child; is the system()
> returning?

it doesn't trigger SIGINT handler. Tested with 5.6.1 and 5.8.1.

use IPC::Run3;

for my $sig (qw(INT TRAP ABRT IO KILL CHLD)) {
     $SIG{$sig} = sub { print STDERR "got SIG$sig\n"; };

my $command = qq[perl -le 'sleep 10; print "done"'];
my $log = '';
system $command;
#run3 $command, \undef, \$log, \$log;
print $log;

Running this and doing Ctrl-C, prints no SIGINT, only SIGCHLD, which is unrelated.

Any ideas how to fix that? It messes things up a bit. It was very clean before 
using run3 (=system) with $SIG{INT}.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message