Hi Monks,
I'm having difficutly porting some CTRL-C acceptance testing from Perl 5.6.1 to Perl 5.8.8. I guess there were issues with:
kill "INT", $pid;
not working on 5.6.1, so we chose to get a Console handle from Win32::Console, and then call:
$console->GenerateCtrlEvent();
after having overriden $SIG{INT} to be ignored in the process that launched the process we want to CTRL-C. This worked great on 5.6.1, but does not work at all on 5.8.8. We never enter the $SIG{INT} handler on 5.8.8 with either the kill function or the GenerateCtrlEvent() call.
The perl process we are trying to signal is launched through on open() call.
open TEST, "perl $d $dir\\ControlC\\ControlC.pl $block $job \$re
+slist=$reslist \$timeout=10 $retry |";
# capture stdout from client under test
my $output = '';
while (<TEST>) {
$output .= $_;
if ( /waiting for control c/i ) {
$SIG{INT} = 'IGNORE';
#kill "INT", $pid;
$console->GenerateCtrlEvent();
Win32::Sleep(100);
$SIG{INT} = 'DEFAULT';
}
}
close TEST;
Is there a reliable way to send a CTRL-C signal to another process using windows XPpro and Perl 5.8.8?
Thanks for your time!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.