diff options
author | Damien Miller <djm@mindrot.org> | 2005-05-24 16:39:03 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2005-05-24 16:39:03 +1000 |
commit | 308c8b147bb6a5598902870675c6c5d5975470aa (patch) | |
tree | cdcc161033c3dbced2511832358e67651455eff6 /openbsd-compat | |
parent | df548bc31062fcc7f5ab618821ab4653b170ec60 (diff) |
nicer fix from millert@
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/readpassphrase.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index b5f4d1ce..5138b403 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -137,10 +137,11 @@ restart: (void)write(output, "\n", 1); /* Restore old terminal settings and signals. */ - if (memcmp(&term, &oterm, sizeof(term)) != 0) - for (;tcsetattr(input, _T_FLUSH, &oterm) == -1 && - errno == EINTR;) - ; + if (memcmp(&term, &oterm, sizeof(term)) != 0) { + while (tcsetattr(input, TCSANOW|TCSASOFT, &oterm) == -1 && + errno == EINTR) + continue; + } (void)sigaction(SIGALRM, &savealrm, NULL); (void)sigaction(SIGHUP, &savehup, NULL); (void)sigaction(SIGINT, &saveint, NULL); |