107 lines
2.3 KiB
Text
107 lines
2.3 KiB
Text
$NetBSD: patch-az,v 1.2 2004/04/15 21:17:08 ben Exp $
|
|
|
|
--- signal.c.orig 1992-06-19 13:55:37.000000000 -0700
|
|
+++ signal.c
|
|
@@ -1,8 +1,11 @@
|
|
/* signal.c */
|
|
+#include <sys/types.h>
|
|
+#include <signal.h>
|
|
+#include <unistd.h>
|
|
#include "header.h"
|
|
#include "extern.h"
|
|
|
|
-s2choose() /* text to be displayed if ^C during intro screen */
|
|
+void s2choose(void) /* text to be displayed if ^C during intro screen */
|
|
{
|
|
cursor(1,24);
|
|
lprcat("Press ");
|
|
@@ -14,7 +17,8 @@ s2choose() /* text to be displayed if ^C
|
|
}
|
|
|
|
SIGTYPE
|
|
-cntlc() /* what to do for an interrupt */
|
|
+cntlc(siggy) /* what to do for an interrupt */
|
|
+int siggy;
|
|
{
|
|
if (nosignal) {
|
|
signal(SIGINT, cntlc);
|
|
@@ -37,7 +41,8 @@ cntlc() /* what to do for an interrupt *
|
|
* subroutine to save the game if a hangup signal
|
|
*/
|
|
SIGTYPE
|
|
-sgam()
|
|
+sgam(siggy)
|
|
+int siggy;
|
|
{
|
|
if (ckpflag) {
|
|
if (fork() == 0) {
|
|
@@ -86,10 +91,10 @@ int sig;
|
|
** sigsave called before a shell escape
|
|
** sigreset called after a shell escape
|
|
*/
|
|
-static SIGTYPE (*intsave)(),
|
|
- (*quitsave)();
|
|
+static SIGTYPE (*intsave)(int),
|
|
+ (*quitsave)(int);
|
|
|
|
-sigsetup()
|
|
+void sigsetup(void)
|
|
{
|
|
SIGTYPE tstop();
|
|
signal(SIGHUP, sgam);
|
|
@@ -98,7 +103,9 @@ sigsetup()
|
|
signal(SIGILL, sigpanic);
|
|
signal(SIGTRAP, sigpanic);
|
|
signal(SIGIOT, sigpanic);
|
|
+#ifdef SIGEMT
|
|
signal(SIGEMT, sigpanic);
|
|
+#endif
|
|
signal(SIGFPE, sigpanic);
|
|
signal(SIGBUS, sigpanic);
|
|
signal(SIGSEGV, sigpanic);
|
|
@@ -110,7 +117,7 @@ sigsetup()
|
|
#endif /* SIGTSTP */
|
|
}
|
|
|
|
-sigsave()
|
|
+void sigsave(void)
|
|
{
|
|
signal(SIGHUP, SIG_DFL);
|
|
intsave = signal(SIGINT, SIG_DFL);
|
|
@@ -118,7 +125,9 @@ sigsave()
|
|
signal(SIGILL, SIG_DFL);
|
|
signal(SIGTRAP, SIG_DFL);
|
|
signal(SIGIOT, SIG_DFL);
|
|
+#ifdef SIGEMT
|
|
signal(SIGEMT, SIG_DFL);
|
|
+#endif
|
|
signal(SIGFPE, SIG_DFL);
|
|
signal(SIGBUS, SIG_DFL);
|
|
signal(SIGSEGV, SIG_DFL);
|
|
@@ -130,7 +139,7 @@ sigsave()
|
|
#endif /* SIGTSTP */
|
|
}
|
|
|
|
-sigreset()
|
|
+void sigreset(void)
|
|
{
|
|
signal(SIGHUP, sgam);
|
|
signal(SIGINT, intsave);
|
|
@@ -138,7 +147,9 @@ sigreset()
|
|
signal(SIGILL, sigpanic);
|
|
signal(SIGTRAP, sigpanic);
|
|
signal(SIGIOT, sigpanic);
|
|
+#ifdef SIGEMT
|
|
signal(SIGEMT, sigpanic);
|
|
+#endif
|
|
signal(SIGFPE, sigpanic);
|
|
signal(SIGBUS, sigpanic);
|
|
signal(SIGSEGV, sigpanic);
|
|
@@ -177,6 +188,7 @@ static char *signame[NSIG] = {
|
|
/*
|
|
* routine to process a fatal error signal
|
|
*/
|
|
+SIGTYPE
|
|
sigpanic(sig)
|
|
int sig;
|
|
{
|