X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/cd6a6786a83c6ffc71841f4c49e6192f2296b2a1..af314729a412f4936a44bcfabe14d34c3b152a82:/warp/sig.c diff --git a/warp/sig.c b/warp/sig.c index 3be78777..f12a6b11 100644 --- a/warp/sig.c +++ b/warp/sig.c @@ -23,11 +23,8 @@ #include "sig.h" void -sig_init() +sig_init(void) { -#ifdef lint - ; -#else sigignore(SIGINT); /* for inquiry of existence via kill call */ #ifdef SIGTTOU sigignore(SIGTTOU); @@ -38,8 +35,10 @@ sig_init() sigset(SIGQUIT, sig_catcher); sigset(SIGILL, sig_catcher); sigset(SIGFPE, sig_catcher); +#if 0 sigset(SIGBUS, sig_catcher); sigset(SIGSEGV, sig_catcher); +#endif sigset(SIGSYS, sig_catcher); sigset(SIGTERM, sig_catcher); } @@ -53,12 +52,11 @@ sig_init() sigset(SIGTSTP, stop_catcher); sigset(SIGSTOP, stop_catcher); #endif -#endif /* lint */ } #ifdef SIGTSTP void -cont_catcher() +cont_catcher(int x) { #ifndef lint sigset(SIGCONT,cont_catcher); @@ -72,7 +70,7 @@ cont_catcher() #endif void -mytstp() +mytstp(void) { resetty(); #ifdef SIGTSTP @@ -94,8 +92,7 @@ mytstp() } void /* very much void */ -finalize(status) -int status; +finalize(int status) { if (bizarre) resetty(); @@ -110,10 +107,10 @@ int status; /* come here on signal other than interrupt, stop, or cont */ void -sig_catcher(signo) +sig_catcher(int signo) { #ifdef VERBOSE - static char *signame[] = { + static const char *signame[] = { "", "HUP", "INT", @@ -180,7 +177,7 @@ sig_catcher(signo) totalscore -= possiblescore / 2; } save_game(); - if (signo != SIGHUP && signo != SIGQUIT) + if (signo != SIGHUP && signo != SIGQUIT) { #ifdef VERBOSE IF(verbose) printf("\r\nCaught %s%s--%s\r\n", @@ -189,8 +186,9 @@ sig_catcher(signo) ELSE #endif #ifdef TERSE - printf("\r\nSignal %d--bye bye\r\n",signo); + printf("\r\nsignal %d--bye bye\r\n",signo); #endif + } switch (signo) { case SIGBUS: case SIGILL: @@ -204,7 +202,7 @@ sig_catcher(signo) /* come here on stop signal */ void -stop_catcher() +stop_catcher(int sig) { if (!waiting) { resetty(); /* this is the point of all this */