home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume17
/
e2
/
part01
/
signal.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-02-08
|
495b
|
36 lines
#include "e.h"
/*
* clean_up()
*
* This is where we come when we get a SIGINT.
*
*/
int
clean_up()
{
/*
* Just get out after making sure things are tidy.
*
*/
e_error("\nInterrupt.");
}
/*
* catch_signals()
*
* Arrange for SIGINT to be dealt with by clean_up().
*
*/
void
catch_signals()
{
if (signal(SIGINT, SIG_IGN) != SIG_IGN){
if (signal(SIGINT, clean_up) == (int (*)())-1){
e_error("Signal fails!");
}
}
return;
}