|
|
1.1 root 1: #
2:
3: #include <signal.h>
4:
5: /*
6: * The following is for systems with botched signal() system entries
7: * which don't return the proper value for the previous signal.
8: */
9:
10: int oldsigs[17];
11:
12: int
13: (*Signal())(sig, spot)
14: int spot;
15: {
16: int ret;
17:
18: /* printf("Signal(%d, %.1o)\n", sig, spot); */
19: if (sig < 1 || sig > 16)
20: return(-1);
21: ret = oldsigs[sig];
22: oldsigs[sig] = (int) spot;
23: signal(sig, spot);
24: return(ret);
25: }
26:
27: Siginit()
28: {
29: register int i;
30:
31: for (i = 1; i < 17; i++) {
32: oldsigs[i] = (int) signal(i, SIG_IGN);
33: signal(i, (int (*)()) oldsigs[i]);
34: }
35: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.