summaryrefslogtreecommitdiff
path: root/openbsd-compat/readpassphrase.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-05-24 16:39:03 +1000
committerDamien Miller <djm@mindrot.org>2005-05-24 16:39:03 +1000
commit308c8b147bb6a5598902870675c6c5d5975470aa (patch)
treecdcc161033c3dbced2511832358e67651455eff6 /openbsd-compat/readpassphrase.c
parentdf548bc31062fcc7f5ab618821ab4653b170ec60 (diff)
nicer fix from millert@
Diffstat (limited to 'openbsd-compat/readpassphrase.c')
-rw-r--r--openbsd-compat/readpassphrase.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c
index b5f4d1ce4..5138b4034 100644
--- a/openbsd-compat/readpassphrase.c
+++ b/openbsd-compat/readpassphrase.c
@@ -137,10 +137,11 @@ restart:
137 (void)write(output, "\n", 1); 137 (void)write(output, "\n", 1);
138 138
139 /* Restore old terminal settings and signals. */ 139 /* Restore old terminal settings and signals. */
140 if (memcmp(&term, &oterm, sizeof(term)) != 0) 140 if (memcmp(&term, &oterm, sizeof(term)) != 0) {
141 for (;tcsetattr(input, _T_FLUSH, &oterm) == -1 && 141 while (tcsetattr(input, TCSANOW|TCSASOFT, &oterm) == -1 &&
142 errno == EINTR;) 142 errno == EINTR)
143 ; 143 continue;
144 }
144 (void)sigaction(SIGALRM, &savealrm, NULL); 145 (void)sigaction(SIGALRM, &savealrm, NULL);
145 (void)sigaction(SIGHUP, &savehup, NULL); 146 (void)sigaction(SIGHUP, &savehup, NULL);
146 (void)sigaction(SIGINT, &saveint, NULL); 147 (void)sigaction(SIGINT, &saveint, NULL);