summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-15 17:13:37 +0000
committerderaadt <deraadt@openbsd.org>2015-01-15 17:13:37 +0000
commite432a8078374b509af58931b40177354e4ce2f09 (patch)
tree2a5a99adc3fbe9484bd01e6bc136380ad3ba6a44
parentMap the sigcode page with MAP_INHERIT_COPY to make sure it isn't shared ater (diff)
downloadwireguard-openbsd-e432a8078374b509af58931b40177354e4ce2f09.tar.xz
wireguard-openbsd-e432a8078374b509af58931b40177354e4ce2f09.zip
NR_OF_EOFS is a festering boil, lance & drain.
ok millert
-rw-r--r--games/hack/hack.tty.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/games/hack/hack.tty.c b/games/hack/hack.tty.c
index 6c8765057af..a4386b048f2 100644
--- a/games/hack/hack.tty.c
+++ b/games/hack/hack.tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hack.tty.c,v 1.11 2009/10/27 23:59:25 deraadt Exp $ */
+/* $OpenBSD: hack.tty.c,v 1.12 2015/01/15 17:13:37 deraadt Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -100,14 +100,6 @@
#include <stdlib.h>
#include <termios.h>
-/*
- * Some systems may have getchar() return EOF for various reasons, and
- * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs.
- */
-#ifndef BSD
-#define NR_OF_EOFS 20
-#endif /* BSD */
-
static char erase_char, kill_char;
static boolean settty_needed = FALSE;
struct termios inittyb, curttyb;
@@ -330,23 +322,7 @@ readchar()
(void) fflush(stdout);
if((sym = getchar()) == EOF)
-#ifdef NR_OF_EOFS
- { /*
- * Some SYSV systems seem to return EOFs for various reasons
- * (?like when one hits break or for interrupted systemcalls?),
- * and we must see several before we quit.
- */
- int cnt = NR_OF_EOFS;
- while (cnt--) {
- clearerr(stdin); /* omit if clearerr is undefined */
- if((sym = getchar()) != EOF) goto noteof;
- }
- end_of_input();
- noteof: ;
- }
-#else
end_of_input();
-#endif /* NR_OF_EOFS */
if(flags.toplin == 1)
flags.toplin = 2;
return((char) sym);