source: trunk/minix/commands/i386/mtools-3.9.7/signal.c@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 614 bytes
Line 
1#include "sysincludes.h"
2#include "mtools.h"
3
4#undef got_signal
5
6int got_signal = 0;
7
8void signal_handler(int dummy)
9{
10 got_signal = 1;
11#if 0
12 signal(SIGHUP, SIG_IGN);
13 signal(SIGINT, SIG_IGN);
14 signal(SIGTERM, SIG_IGN);
15 signal(SIGQUIT, SIG_IGN);
16#endif
17}
18
19#if 0
20int do_gotsignal(char *f, int n)
21{
22 if(got_signal)
23 fprintf(stderr, "file=%s line=%d\n", f, n);
24 return got_signal;
25}
26#endif
27
28void setup_signal(void)
29{
30 /* catch signals */
31 signal(SIGHUP, (SIG_CAST)signal_handler);
32 signal(SIGINT, (SIG_CAST)signal_handler);
33 signal(SIGTERM, (SIG_CAST)signal_handler);
34 signal(SIGQUIT, (SIG_CAST)signal_handler);
35}
Note: See TracBrowser for help on using the repository browser.