signal now deals with void functions
This commit is contained in:
parent
82f89c97a6
commit
cf151967a5
|
@ -9,7 +9,7 @@ char *prompt;
|
|||
struct sgttyb tty, ttysave;
|
||||
static char pwdbuf[9];
|
||||
int fd;
|
||||
int (*savesig)();
|
||||
void (*savesig)();
|
||||
|
||||
if ((fd = open("/dev/tty", 0)) < 0) fd = 0;
|
||||
savesig = signal(SIGINT, SIG_IGN);
|
||||
|
|
|
@ -40,8 +40,8 @@ pclose(iop)
|
|||
{
|
||||
int fd = fileno(iop);
|
||||
int status, wret;
|
||||
int (*intsave)() = signal(SIGINT, SIG_IGN);
|
||||
int (*quitsave)() = signal(SIGQUIT, SIG_IGN);
|
||||
void (*intsave)() = signal(SIGINT, SIG_IGN);
|
||||
void (*quitsave)() = signal(SIGQUIT, SIG_IGN);
|
||||
|
||||
fclose(iop);
|
||||
while ((wret = wait(&status)) != -1) {
|
||||
|
|
|
@ -5,7 +5,7 @@ system(str)
|
|||
char *str;
|
||||
{
|
||||
int pid, exitstatus, waitval;
|
||||
int (*sigint)(), (*sigquit)();
|
||||
void (*sigint)(), (*sigquit)();
|
||||
int i;
|
||||
|
||||
if ((pid = fork()) < 0) return -1; /* How do we distinguish this
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "f2c.h"
|
||||
#define PAUSESIG 15
|
||||
|
||||
static waitpause()
|
||||
static void waitpause()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "f2c.h"
|
||||
|
||||
typedef int (*sig_type)();
|
||||
typedef void (*sig_type)();
|
||||
extern sig_type signal();
|
||||
|
||||
integer signal_(sigp, procp)
|
||||
|
|
|
@ -86,7 +86,7 @@ void chan_out(v, c) long v; register chan *c;
|
|||
}
|
||||
|
||||
#ifndef __BSD4_2
|
||||
static int timeout();
|
||||
static void timeout();
|
||||
#endif
|
||||
|
||||
int chan_any(c) register chan *c;
|
||||
|
@ -170,7 +170,7 @@ int chan_any(c) register chan *c;
|
|||
* timeout() to prevent it from getting lost.
|
||||
*/
|
||||
|
||||
static int timeout(sig)
|
||||
static void timeout(sig)
|
||||
{
|
||||
signal(SIGALRM, timeout);
|
||||
alarm(1);
|
||||
|
|
|
@ -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