-/* $Header: /cvsroot/src/games/warp/sig.c,v 1.1 2020/11/09 23:37:05 kamil Exp $ */
+/* Header: /usr/src/games/warp/RCS/sig.c,v 1.1 87/07/03 01:47:11 games Exp */
-/* $Log: sig.c,v $
-/* Revision 1.1 2020/11/09 23:37:05 kamil
-/* Add Warp Kit, Version 7.0 by Larry Wall
-/*
-/* Warp is a real-time space war game that doesn't get boring very quickly.
-/* Read warp.doc and the manual page for more information.
-/*
-/* games/warp originally distributed with 4.3BSD-Reno, is back to the BSD
-/* world via NetBSD. Its remnants were still mentioned in games/Makefile.
-/*
-/* Larry Wall, the original author and the copyright holder, generously
-/* donated the game and copyright to The NetBSD Foundation, Inc.
-/*
-/* Import the game sources as-is from 4.3BSD-Reno, with the cession
-/* of the copyright and license to BSD-2-clause NetBSD-style.
-/*
-/* Signed-off-by: Larry Wall <larry@wall.org>
-/* Signed-off-by: Kamil Rytarowski <kamil@netbsd.org>
-/*
+/* Log: sig.c,v
* Revision 7.0.1.1a 87/07/03 01:47:11 games
* Changed sigsetmask to use sigmask instead of calculating it (incorrectly)
* by hand.
#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);
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);
}
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);
#endif
void
-mytstp()
+mytstp(void)
{
resetty();
#ifdef SIGTSTP
}
void /* very much void */
-finalize(status)
-int status;
+finalize(int status)
{
if (bizarre)
resetty();
/* 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",
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",
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:
/* come here on stop signal */
void
-stop_catcher()
+stop_catcher(int sig)
{
if (!waiting) {
resetty(); /* this is the point of all this */