signal now deals with void functions
This commit is contained in:
parent
2309d12210
commit
82f89c97a6
|
@ -17,6 +17,7 @@ int nr;
|
|||
/*debug printf("trap set to %d\n",nr);*/
|
||||
_trpline=nr;
|
||||
}
|
||||
void
|
||||
_trpfatal(i)
|
||||
int i;
|
||||
{
|
||||
|
@ -35,7 +36,7 @@ int i;
|
|||
_ini_trp()
|
||||
{
|
||||
/* initialize trap routines */
|
||||
int i, _trpfatal();
|
||||
int i;
|
||||
|
||||
for(i=0;i<NSIG;i++)
|
||||
signal(i,_trpfatal);
|
||||
|
|
|
@ -8,7 +8,7 @@ DEFINITION MODULE Unix;
|
|||
FROM SYSTEM IMPORT WORD, ADDRESS;
|
||||
|
||||
(* Type needed for Signal *)
|
||||
TYPE SignalPrc = PROCEDURE(INTEGER):INTEGER;
|
||||
TYPE SignalPrc = PROCEDURE(INTEGER);
|
||||
CONST
|
||||
SIGDFL = SignalPrc(NIL);
|
||||
SIGIGN = SignalPrc(NIL+1);
|
||||
|
@ -99,8 +99,7 @@ DEFINITION MODULE Unix;
|
|||
PROCEDURE setuid(uid: INTEGER) : INTEGER;
|
||||
PROCEDURE setgid(gid: INTEGER) : INTEGER;
|
||||
PROCEDURE signal(sig: INTEGER;
|
||||
func: SignalPrc;
|
||||
VAR oldfunc: SignalPrc) : INTEGER;
|
||||
func: SignalPrc) : SignalPrc;
|
||||
PROCEDURE sigtrp(trapno, signo: INTEGER) : INTEGER;
|
||||
(* Let Unix signal signo cause EM trap trapno to occur *)
|
||||
PROCEDURE stat(path: ADDRESS; statbuf: ADDRESS) : INTEGER;
|
||||
|
|
|
@ -25,7 +25,7 @@ static int __traps[] = {
|
|||
-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
|
||||
};
|
||||
|
||||
static int
|
||||
static void
|
||||
__ctchsig(signo)
|
||||
{
|
||||
signal(signo,__ctchsig);
|
||||
|
@ -47,8 +47,8 @@ sigtrp(trapno, signo)
|
|||
indicates failure, with error number in errno.
|
||||
*/
|
||||
extern int errno;
|
||||
int (*ctch)() = __ctchsig;
|
||||
int (*oldctch)();
|
||||
void (*ctch)() = __ctchsig;
|
||||
void (*oldctch)();
|
||||
int oldtrap;
|
||||
|
||||
if (signo <= 0 || signo >= sizeof(__traps)/sizeof(__traps[0])) {
|
||||
|
@ -69,7 +69,7 @@ sigtrp(trapno, signo)
|
|||
|
||||
oldtrap = __traps[signo];
|
||||
|
||||
if ((oldctch = signal(signo, ctch)) == (int (*)())-1) /* errno set by signal */
|
||||
if ((oldctch = signal(signo, ctch)) == (void (*)())-1) /* errno set by signal */
|
||||
return -1;
|
||||
|
||||
else if (oldctch == SIG_IGN) {
|
||||
|
|
Loading…
Reference in a new issue