summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2005-04-21 09:00:26 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2005-04-21 09:00:26 +0000
commited981ca999b10a3e72f2e4244127e8f3f23bde66 (patch)
tree696685f6483d554ad7103e9f6c568a92c2933e60
parentc40b8e93ace00393bc6436f6c9f0f287d0a26d0a (diff)
Avoid the "tcsetattr: Interrupted system call" fatal error when
resizing using a window manager that continously sends resize events. ok camield@ miod@
-rw-r--r--usr.bin/vi/cl/cl_screen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/vi/cl/cl_screen.c b/usr.bin/vi/cl/cl_screen.c
index aeb5b00b81d..22fac8f8249 100644
--- a/usr.bin/vi/cl/cl_screen.c
+++ b/usr.bin/vi/cl/cl_screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_screen.c,v 1.14 2003/07/18 23:11:43 david Exp $ */
+/* $OpenBSD: cl_screen.c,v 1.15 2005/04/21 09:00:25 otto Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -371,6 +371,8 @@ cl_vi_init(sp)
fast: /* Set the terminal modes. */
if (tcsetattr(STDIN_FILENO, TCSASOFT | TCSADRAIN, &clp->vi_enter)) {
+ if (errno == EINTR)
+ goto fast;
msgq(sp, M_SYSERR, "tcsetattr");
err: (void)cl_vi_end(sp->gp);
return (1);
@@ -489,6 +491,8 @@ cl_ex_init(sp)
#endif
fast: if (tcsetattr(STDIN_FILENO, TCSADRAIN | TCSASOFT, &clp->ex_enter)) {
+ if (errno == EINTR)
+ goto fast;
msgq(sp, M_SYSERR, "tcsetattr");
return (1);
}