diff options
author | Anders Johnson <ajohnson@nvidia.com> | 2003-02-10 06:09:46 -0800 |
---|---|---|
committer | hv <hv@crypt.org> | 2003-03-02 16:12:34 +0000 |
commit | 2d4fcd5e8be8d83efa948a259c49b56fc6c27ee5 (patch) | |
tree | 15c09910b1c6ea433dcf423bffb482f20bbcaba8 /t/op/magic.t | |
parent | 81ff9b36babbaa3576696f80427c25a4b7bfa9dd (diff) | |
download | perl-2d4fcd5e8be8d83efa948a259c49b56fc6c27ee5.tar.gz |
RE: [perl #20613] Perl_magic_setsig/clearsig problems (patch included)
From: "Anders Johnson" <ajohnson@wischip.com>
Message-ID: <000e01c2d151$2228ca90$9800a8c0@wis.com>
p4raw-id: //depot/perl@18803
Diffstat (limited to 't/op/magic.t')
-rwxr-xr-x | t/op/magic.t | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/t/op/magic.t b/t/op/magic.t index 0619c0dc34..8f598a1049 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -36,7 +36,7 @@ sub skip { return 1; } -print "1..50\n"; +print "1..52\n"; $Is_MSWin32 = $^O eq 'MSWin32'; $Is_NetWare = $^O eq 'NetWare'; @@ -67,7 +67,7 @@ ok $!, $!; close FOO; # just mention it, squelch used-only-once if ($Is_MSWin32 || $Is_NetWare || $Is_Dos || $Is_MPE || $Is_MacOS) { - skip('SIGINT not safe on this platform') for 1..2; + skip('SIGINT not safe on this platform') for 1..4; } else { # the next tests are done in a subprocess because sh spits out a @@ -98,7 +98,35 @@ END close CMDPIPE; - $test += 2; + open( CMDPIPE, "| $PERL"); + print CMDPIPE <<'END'; + + { package X; + sub DESTROY { + kill "INT",$$; + } + } + sub x { + my $x=bless [], 'X'; + return sub { $x }; + } + $| = 1; # command buffering + $SIG{"INT"} = "ok5"; + { + local $SIG{"INT"}=x(); + print ""; # Needed to expose failure in 5.8.0 (why?) + } + sleep 1; + delete $SIG{"INT"}; + kill "INT",$$; sleep 1; + sub ok5 { + print "ok 5\n"; + } +END + close CMDPIPE; + print $? & 0xFF ? "ok 6\n" : "not ok 6\n"; + + $test += 4; } # can we slice ENV? |