home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_03
/
9n03124b
< prev
next >
Wrap
Text File
|
1991-01-16
|
491b
|
24 lines
jmp_buf env;
int valid_env = 0;
void sig_handler(sig)
int sig;
{
assert(sig >= 0 && sig < NSIG);
if (!actions[sig]) {
/* always an error except when sig == 0 */
if (sig == 0) return;
fprintf(stderr,"unexpected signal (%d) delivered\n", sig);
} else {
signal(sig, sig_handler);
eval(actions[sig]);
}
if (valid_env) longjmp(env,1);
}
Listing 2