summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/ed.term.c
diff options
context:
space:
mode:
authormp <mp@FreeBSD.org>2001-09-05 17:49:32 +0000
committermp <mp@FreeBSD.org>2001-09-05 17:49:32 +0000
commit538cdbc622d96ebd9ba6fae4c5b21f8704e88d90 (patch)
tree836fb15b752f30ac10f0e8bc35125091d7a821a3 /contrib/tcsh/ed.term.c
parent9b07833722e76f7d023c491eaf74bf278221b55d (diff)
downloadFreeBSD-src-538cdbc622d96ebd9ba6fae4c5b21f8704e88d90.zip
FreeBSD-src-538cdbc622d96ebd9ba6fae4c5b21f8704e88d90.tar.gz
Import tcsh-6.11
Diffstat (limited to 'contrib/tcsh/ed.term.c')
-rw-r--r--contrib/tcsh/ed.term.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/contrib/tcsh/ed.term.c b/contrib/tcsh/ed.term.c
index b7ea987..00f932d 100644
--- a/contrib/tcsh/ed.term.c
+++ b/contrib/tcsh/ed.term.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/ed.term.c,v 1.25 2000/11/11 23:03:34 christos Exp $ */
+/* $Header: /src/pub/tcsh/ed.term.c,v 1.26 2001/08/06 23:51:09 christos Exp $ */
/*
* ed.term.c: Low level terminal interface
*/
@@ -37,7 +37,7 @@
#include "sh.h"
#ifndef WINNT_NATIVE
-RCSID("$Id: ed.term.c,v 1.25 2000/11/11 23:03:34 christos Exp $")
+RCSID("$Id: ed.term.c,v 1.26 2001/08/06 23:51:09 christos Exp $")
#include "ed.h"
#include "ed.term.h"
@@ -566,14 +566,21 @@ static struct tcshmodes {
# define OKERROR(e) ((e) == EINTR)
#endif
+#ifdef __NetBSD__
+#define KLUDGE (errno == ENOTTY && count < 10)
+#else
+#define KLUDGE 0
+#endif
+
/* Retry a system call */
+static int count;
#define RETRY(x) \
- for (;;) \
+ for (count = 0;; count++) \
if ((x) == -1) { \
- if (OKERROR(errno)) \
- continue; \
- else \
- return -1; \
+ if (OKERROR(errno) || KLUDGE) \
+ continue; \
+ else \
+ return -1; \
} \
else \
break \
OpenPOWER on IntegriCloud