develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [ID 20010828.006] problem with sigaction and SIGALRM

Thread Previous
From:
Abhijit Menon-Sen
Date:
August 28, 2001 19:45
Subject:
Re: [ID 20010828.006] problem with sigaction and SIGALRM
Message ID:
20010829081455.M727@lustre.dyn.wiw.org
At 2001-08-28 19:04:18, esp5@rama.comp.pge.com wrote:
> 
>     > my $alarm = 0;  
>     > sigaction SIGALRM, new POSIX::SigAction sub { $alarm = 1 }
>         > or die "Error setting SIGALRM handler: $!\n";
> 
> Now this would be really nice, except it *doesn't* work.

Does this help?

- ams

--- ext/POSIX/POSIX.xs~	Tue Apr 24 00:53:22 2001
+++ ext/POSIX/POSIX.xs	Tue Apr 24 02:26:18 2001
@@ -3410,7 +3410,7 @@
 		svp = hv_fetch(action, "HANDLER", 7, FALSE);
 		if (!svp)
 		    croak("Can't supply an action without a HANDLER");
-		sv_setpv(*sigsvp, SvPV(*svp, n_a));
+		sv_setsv(*sigsvp, *svp);
 		mg_set(*sigsvp);	/* handles DEFAULT and IGNORE */
 		act.sa_handler = PL_sighandlerp;
 


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About