From df548bc31062fcc7f5ab618821ab4653b170ec60 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 24 May 2005 15:54:27 +1000 Subject: - (djm) [openbsd-compat/readpassphrase.c] bz #950: Retry tcsetattr to ensure terminal modes are reset correctly. Fix from peak AT argo.troja.mff.cuni.cz; "looks ok" dtucker@ --- openbsd-compat/readpassphrase.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openbsd-compat/readpassphrase.c') diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index 4ee1be5de..b5f4d1ce4 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -138,7 +138,9 @@ restart: /* Restore old terminal settings and signals. */ if (memcmp(&term, &oterm, sizeof(term)) != 0) - (void)tcsetattr(input, _T_FLUSH, &oterm); + for (;tcsetattr(input, _T_FLUSH, &oterm) == -1 && + errno == EINTR;) + ; (void)sigaction(SIGALRM, &savealrm, NULL); (void)sigaction(SIGHUP, &savehup, NULL); (void)sigaction(SIGINT, &saveint, NULL); -- cgit v1.2.3