BSD 4 development
[unix-history] / usr / src / cmd / ucbmail / Signal.c
CommitLineData
c8eb690c
BJ
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
10int oldsigs[17];
11
12int
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
27Siginit()
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}