diff options
author | 2014-07-12 03:41:04 +0000 | |
---|---|---|
committer | 2014-07-12 03:41:04 +0000 | |
commit | cb127fae54d6953435c45a9f60fc3eaa427c5678 (patch) | |
tree | 7c813e7a534d6aed51366f9eef296f4cfa9cf678 | |
parent | config-def.h is now unnecessary; merge config-data.h into defs.h (diff) | |
download | wireguard-openbsd-cb127fae54d6953435c45a9f60fc3eaa427c5678.tar.xz wireguard-openbsd-cb127fae54d6953435c45a9f60fc3eaa427c5678.zip |
Remove a pile of (obviously unused) #ifdef SYSV and BSD41 and BSD42
code that catches lots of signals, and then re-enters curses... before
exiting.
-rw-r--r-- | games/phantasia/fight.c | 6 | ||||
-rw-r--r-- | games/phantasia/interplayer.c | 6 | ||||
-rw-r--r-- | games/phantasia/io.c | 20 | ||||
-rw-r--r-- | games/phantasia/main.c | 93 | ||||
-rw-r--r-- | games/phantasia/misc.c | 38 |
5 files changed, 5 insertions, 158 deletions
diff --git a/games/phantasia/fight.c b/games/phantasia/fight.c index a35c02e06e5..8acc59a9756 100644 --- a/games/phantasia/fight.c +++ b/games/phantasia/fight.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fight.c,v 1.10 2010/12/15 06:40:39 tedu Exp $ */ +/* $OpenBSD: fight.c,v 1.11 2014/07/12 03:41:04 deraadt Exp $ */ /* $NetBSD: fight.c,v 1.2 1995/03/24 03:58:39 cgd Exp $ */ /* @@ -49,10 +49,6 @@ encounter(particular) Player.p_status = S_MONSTER; writerecord(&Player, Fileloc); -#ifdef SYS5 - flushinp(); -#endif - Shield = 0.0; /* no shield up yet */ if (particular >= 0) diff --git a/games/phantasia/interplayer.c b/games/phantasia/interplayer.c index 950d69ef7d2..d50a7031add 100644 --- a/games/phantasia/interplayer.c +++ b/games/phantasia/interplayer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interplayer.c,v 1.5 2010/12/15 06:40:39 tedu Exp $ */ +/* $OpenBSD: interplayer.c,v 1.6 2014/07/12 03:41:04 deraadt Exp $ */ /* $NetBSD: interplayer.c,v 1.2 1995/03/24 03:58:47 cgd Exp $ */ /* @@ -124,10 +124,6 @@ battleplayer(foeplace) mvaddstr(4, 0, "Preparing for battle!\n"); refresh(); -#ifdef SYS5 - flushinp(); -#endif - /* set up variables, file, etc. */ Player.p_status = S_INBATTLE; Shield = Player.p_energy; diff --git a/games/phantasia/io.c b/games/phantasia/io.c index 5d0cbce9da1..881bf3a567f 100644 --- a/games/phantasia/io.c +++ b/games/phantasia/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.5 2002/01/16 01:28:54 millert Exp $ */ +/* $OpenBSD: io.c,v 1.6 2014/07/12 03:41:04 deraadt Exp $ */ /* $NetBSD: io.c,v 1.2 1995/03/24 03:58:50 cgd Exp $ */ /* @@ -241,13 +241,6 @@ interrupt() int ch; /* input */ unsigned savealarm; /* to save alarm value */ -#ifdef SYS3 - signal(SIGINT, SIG_IGN); -#endif -#ifdef SYS5 - signal(SIGINT, SIG_IGN); -#endif - savealarm = alarm(0); /* turn off any alarms */ getyx(stdscr, y, x); /* save cursor location */ @@ -278,13 +271,6 @@ interrupt() move(y, x); /* restore cursor */ refresh(); -#ifdef SYS3 - signal(SIGINT, interrupt); -#endif -#ifdef SYS5 - signal(SIGINT, interrupt); -#endif - alarm(savealarm); /* restore alarm */ } /**/ @@ -350,11 +336,7 @@ getanswer(choices, def) { clrtoeol(); refresh(); -#ifdef BSD41 - sigset(SIGALRM, catchalarm); -#else signal(SIGALRM, catchalarm); -#endif /* set timeout */ if (Timeout) alarm(7); /* short */ diff --git a/games/phantasia/main.c b/games/phantasia/main.c index 14f02408aed..0b96d91d09d 100644 --- a/games/phantasia/main.c +++ b/games/phantasia/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.15 2013/08/29 20:22:17 naddy Exp $ */ +/* $OpenBSD: main.c,v 1.16 2014/07/12 03:41:04 deraadt Exp $ */ /* $NetBSD: main.c,v 1.3 1995/04/24 12:24:37 cgd Exp $ */ /* @@ -202,20 +202,6 @@ main(argc, argv) Statptr = &Stattable[Player.p_type]; /* initialize pointer */ - /* catch interrupts */ -#ifdef BSD41 - sigset(SIGINT, interrupt); -#endif -#ifdef BSD42 - signal(SIGINT, interrupt); -#endif -#ifdef SYS3 - signal(SIGINT, interrupt); -#endif -#ifdef SYS5 - signal(SIGINT, interrupt); -#endif - altercoordinates(Player.p_x, Player.p_y, A_FORCED); /* set some flags */ clear(); @@ -1166,83 +1152,6 @@ genchar(type) void playinit() { - /* catch/ignore signals */ - -#ifdef BSD41 - sigignore(SIGQUIT); - sigignore(SIGALRM); - sigignore(SIGTERM); - sigignore(SIGTSTP); - sigignore(SIGTTIN); - sigignore(SIGTTOU); - sighold(SIGINT); - sigset(SIGHUP, ill_sig); - sigset(SIGTRAP, ill_sig); - sigset(SIGIOT, ill_sig); - sigset(SIGEMT, ill_sig); - sigset(SIGFPE, ill_sig); - sigset(SIGBUS, ill_sig); -#ifdef SIGSEGV_CHECK - sigset(SIGSEGV, ill_sig); -#endif - sigset(SIGSYS, ill_sig); - sigset(SIGPIPE, ill_sig); -#endif -#ifdef BSD42 - signal(SIGQUIT, ill_sig); - signal(SIGALRM, SIG_IGN); - signal(SIGTERM, SIG_IGN); - signal(SIGTSTP, SIG_IGN); - signal(SIGTTIN, SIG_IGN); - signal(SIGTTOU, SIG_IGN); - signal(SIGINT, ill_sig); - signal(SIGHUP, SIG_DFL); - signal(SIGTRAP, ill_sig); - signal(SIGIOT, ill_sig); - signal(SIGEMT, ill_sig); - signal(SIGFPE, ill_sig); - signal(SIGBUS, ill_sig); -#ifdef SIGSEGV_CHECK - signal(SIGSEGV, ill_sig); -#endif - signal(SIGSYS, ill_sig); - signal(SIGPIPE, ill_sig); -#endif -#ifdef SYS3 - signal(SIGINT, SIG_IGN); - signal(SIGQUIT, SIG_IGN); - signal(SIGTERM, SIG_IGN); - signal(SIGALRM, SIG_IGN); - signal(SIGHUP, ill_sig); - signal(SIGTRAP, ill_sig); - signal(SIGIOT, ill_sig); - signal(SIGEMT, ill_sig); - signal(SIGFPE, ill_sig); - signal(SIGBUS, ill_sig); -#ifdef SIGSEGV_CHECK - signal(SIGSEGV, ill_sig); -#endif - signal(SIGSYS, ill_sig); - signal(SIGPIPE, ill_sig); -#endif -#ifdef SYS5 - signal(SIGINT, SIG_IGN); - signal(SIGQUIT, SIG_IGN); - signal(SIGTERM, SIG_IGN); - signal(SIGALRM, SIG_IGN); - signal(SIGHUP, ill_sig); - signal(SIGTRAP, ill_sig); - signal(SIGIOT, ill_sig); - signal(SIGEMT, ill_sig); - signal(SIGFPE, ill_sig); - signal(SIGBUS, ill_sig); -#ifdef SIGSEGV_CHECK - signal(SIGSEGV, ill_sig); -#endif - signal(SIGSYS, ill_sig); - signal(SIGPIPE, ill_sig); -#endif - initscr(); /* turn on curses */ noecho(); /* do not echo input */ cbreak(); /* do not process erase, kill */ diff --git a/games/phantasia/misc.c b/games/phantasia/misc.c index c9c043baf0a..ccab3f5daa1 100644 --- a/games/phantasia/misc.c +++ b/games/phantasia/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.15 2013/08/29 20:22:17 naddy Exp $ */ +/* $OpenBSD: misc.c,v 1.16 2014/07/12 03:41:04 deraadt Exp $ */ /* $NetBSD: misc.c,v 1.2 1995/03/24 03:59:03 cgd Exp $ */ /* @@ -1465,42 +1465,6 @@ distance(x1, x2, y1, y2) deltay = y1 - y2; return (sqrt(deltax * deltax + deltay * deltay)); } -/**/ -/************************************************************************ -/ -/ FUNCTION NAME: ill_sig() -/ -/ FUNCTION: exit upon trapping an illegal signal -/ -/ AUTHOR: E. A. Estes, 12/4/85 -/ -/ ARGUMENTS: -/ int whichsig - signal which occurred to cause jump to here -/ -/ RETURN VALUE: none -/ -/ MODULES CALLED: wclear(), printw(), cleanup() -/ -/ GLOBAL INPUTS: *stdscr -/ -/ GLOBAL OUTPUTS: none -/ -/ DESCRIPTION: -/ When an illegal signal is caught, print a message, and cleanup. -/ -*************************************************************************/ - -void -ill_sig(whichsig) - int whichsig; -{ - clear(); - if (!(whichsig == SIGINT || whichsig == SIGQUIT)) - printw("Error: caught signal # %d.\n", whichsig); - cleanup(TRUE); - /* NOTREACHED */ -} -/**/ /************************************************************************ / / FUNCTION NAME: descrstatus() |