lkml.org 
[lkml]   [1999]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Q: Signal processing
On Sat, Aug 07, 1999 at 08:53:16PM -0400, Richard B. Johnson wrote:
> Sure:
>
> int sig_caugth;
>
> void sig_handler(int sig)
> {
> sig_caught = sig;
> }
>
> prog()
> {
> sig_caugth = NOTHING;
> .....; /* set up signal handler */
> .....;
> pause(); /* Wait for a signal */
> /* Control returns here soon after your sig_hangler() returns */
>
> switch(sig_caught)
> {
> .....;
> }
> }

You missed a volatile!

--
Kurt Garloff <garloff@suse.de> Wuppertal, FRG
PGP2 key: See mail header, key servers Linux kernel development
SuSE GmbH, Nürnberg, FRG SCSI drivers: tmscsim(DC390), DC395
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.073 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site