signal now deals with void functions
This commit is contained in:
parent
1ac5aa547d
commit
e3e19a7a0d
|
@ -4,7 +4,7 @@
|
|||
|
||||
static jmp_buf setjmpbuf;
|
||||
|
||||
static
|
||||
static void
|
||||
alfun(){
|
||||
longjmp(setjmpbuf, 1);
|
||||
} /* used with sleep() below */
|
||||
|
@ -14,7 +14,7 @@ sleep(n)
|
|||
{
|
||||
/* sleep(n) pauses for 'n' seconds by scheduling an alarm interrupt. */
|
||||
unsigned oldalarm;
|
||||
int (*oldsig)();
|
||||
void (*oldsig)();
|
||||
|
||||
if (n <= 0) return;
|
||||
if (setjmp(setjmpbuf)) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* $Header$ */
|
||||
#include <signal.h>
|
||||
|
||||
typedef int (*callvec)() ;
|
||||
typedef void (*callvec)() ;
|
||||
|
||||
static callvec vector[16] = {
|
||||
SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL,
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
static long masks[32];
|
||||
static long flags[32];
|
||||
int (*
|
||||
void (*
|
||||
signal(sig,handler))()
|
||||
int (*handler)();
|
||||
void (*handler)();
|
||||
{
|
||||
struct {
|
||||
int (*sv_handler)();
|
||||
void (*sv_handler)();
|
||||
long sv_mask;
|
||||
long sv_flags;
|
||||
} v, ov;
|
||||
|
@ -13,13 +13,13 @@ signal(sig,handler))()
|
|||
v.sv_handler = handler;
|
||||
v.sv_mask = masks[sig];
|
||||
v.sv_flags = flags[sig];
|
||||
if (sigvec(sig,&v, &ov) < 0) return (int (*)()) -1;
|
||||
if (sigvec(sig,&v, &ov) < 0) return (void (*)()) -1;
|
||||
if (v.sv_mask != ov.sv_mask || v.sv_flags != ov.sv_flags) {
|
||||
v.sv_mask = ov.sv_mask;
|
||||
masks[sig] = ov.sv_mask;
|
||||
v.sv_flags = ov.sv_flags;
|
||||
flags[sig] = ov.sv_flags;
|
||||
if (sigvec(sig,&v,(char *) 0) < 0) return (int (*)()) -1;
|
||||
if (sigvec(sig,&v,(char *) 0) < 0) return (void (*)()) -1;
|
||||
}
|
||||
return ov.sv_handler;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
static long masks[32];
|
||||
static long flags[32];
|
||||
int (*
|
||||
void (*
|
||||
signal(sig,handler))()
|
||||
int (*handler)();
|
||||
void (*handler)();
|
||||
{
|
||||
struct {
|
||||
int (*sv_handler)();
|
||||
void (*sv_handler)();
|
||||
long sv_mask;
|
||||
long sv_flags;
|
||||
} v, ov;
|
||||
|
@ -13,13 +13,13 @@ signal(sig,handler))()
|
|||
v.sv_handler = handler;
|
||||
v.sv_mask = masks[sig];
|
||||
v.sv_flags = flags[sig];
|
||||
if (_sigvec(sig,&v, &ov) < 0) return (int (*)()) -1;
|
||||
if (_sigvec(sig,&v, &ov) < 0) return (void (*)()) -1;
|
||||
if (v.sv_mask != ov.sv_mask || v.sv_flags != ov.sv_flags) {
|
||||
v.sv_mask = ov.sv_mask;
|
||||
masks[sig] = ov.sv_mask;
|
||||
v.sv_flags = ov.sv_flags;
|
||||
flags[sig] = ov.sv_flags;
|
||||
if (_sigvec(sig,&v,(char *) 0) < 0) return (int (*)()) -1;
|
||||
if (_sigvec(sig,&v,(char *) 0) < 0) return (void (*)()) -1;
|
||||
}
|
||||
return ov.sv_handler;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue