Skip Menu |
 

This queue is for tickets about the Sys-SigAction CPAN distribution.

Report information
The Basics
Id: 19916
Status: resolved
Worked: 1.5 hours (90 min)
Priority: 0/
Queue: Sys-SigAction

People
Owner: Nobody in particular
Requestors: steve [...] purkis.ca
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.04
Fixed in: (no value)



Subject: does not set safe signals properly
Download (untitled) / with headers
text/plain 806b
Hiya, Thanks for a handy module :-) I've just noticed that Sys::SigAction doesn't set 'safe' signals correctly: sub mk_sig_action($$) { my ( $handler ,$attrs ) = @_; ... my $act = POSIX::SigAction->new( $handler ,$mask ,$attrs->{flags} ,$attrs->{safe} ); return $act; } Problem is, POSIX::SigAction->new() doesn't take the 4th parameter to mean 'SAFE': package POSIX::SigAction; use AutoLoader 'AUTOLOAD'; sub new { bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0, SAFE => 0}, $_[0] } I'd suggest fixing this by either: my $act = POSIX::SigAction->new( $handler ,$mask ,$attrs->{flags} ,SAFE => $attrs-> {safe} ); or, in keeping with the API docs: my $act = POSIX::SigAction->new( $handler ,$mask ,$attrs->{flags} ); $act->safe( $attrs->{safe} ); hth, -Steve
From: lab [...] lincolnbaxter.com
Download (untitled) / with headers
text/plain 961b
On Thu Jun 15 07:48:04 2006, guest wrote: Show quoted text
> Hiya, > > Thanks for a handy module :-) > > I've just noticed that Sys::SigAction doesn't set 'safe' signals > correctly: > > sub mk_sig_action($$) > { > my ( $handler ,$attrs ) = @_; > ... > my $act = POSIX::SigAction->new( $handler ,$mask ,$attrs->{flags} > ,$attrs->{safe} ); > return $act; > } > > > Problem is, POSIX::SigAction->new() doesn't take the 4th parameter to > mean 'SAFE': > > package POSIX::SigAction; > use AutoLoader 'AUTOLOAD'; > sub new { bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0, > SAFE => 0}, $_[0] } > > I'd suggest fixing this by either: > > my $act = POSIX::SigAction->new( $handler ,$mask ,$attrs->{flags} > ,SAFE => $attrs-> > {safe} ); > > or, in keeping with the API docs: > > my $act = POSIX::SigAction->new( $handler ,$mask ,$attrs->{flags} > ); > $act->safe( $attrs->{safe} ); > > hth, > -Steve
Thanks, looking into it. Lincoln
Download (untitled) / with headers
text/plain 358b
I just uploaded version 0.06. Thanks for the suggestion. The change broke several of the tests in attrs.t. I changed the arguments from safe=>1 to safe=>0 to get them working again. Did the same in the Oracle example. I would love a suggestion for a test case for testing Safe Signal handling. I documented these changes in the Changes file. Lincoln


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.