From 914f693742de619d131ec267437e30bd04b6e33e Mon Sep 17 00:00:00 2001 From: skimo Date: Fri, 3 May 2002 19:59:44 +0000 Subject: [PATCH] o nvi failed to correctly handle EINTR returned from tcsetattr(), exiting instead of recovering, which happens in particular during a rapid series of SIGWINCH's. This change forces nvi to loop on the call in the event that the call is interrupted. (From FreeBSD; communicated by Sheldon Hearn) --- cl/cl_screen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cl/cl_screen.c b/cl/cl_screen.c index eed7145b..292b88d1 100644 --- a/cl/cl_screen.c +++ b/cl/cl_screen.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: cl_screen.c,v 10.55 2001/08/28 11:33:40 skimo Exp $ (Berkeley) $Date: 2001/08/28 11:33:40 $"; +static const char sccsid[] = "$Id: cl_screen.c,v 10.56 2002/05/03 19:59:44 skimo Exp $ (Berkeley) $Date: 2002/05/03 19:59:44 $"; #endif /* not lint */ #include @@ -369,6 +369,8 @@ cl_vi_init(SCR *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); @@ -485,6 +487,8 @@ cl_ex_init(SCR *sp) #endif fast: if (tcsetattr(STDIN_FILENO, TCSADRAIN | TCSASOFT, &clp->ex_enter)) { + if (errno == EINTR) + goto fast; msgq(sp, M_SYSERR, "tcsetattr"); return (1); } -- 2.11.4.GIT