diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/readpassphrase.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libc/gen/readpassphrase.c b/lib/libc/gen/readpassphrase.c index 2eb7eb5d69d..ece1423d509 100644 --- a/lib/libc/gen/readpassphrase.c +++ b/lib/libc/gen/readpassphrase.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readpassphrase.c,v 1.16 2003/06/17 21:56:23 millert Exp $ */ +/* $OpenBSD: readpassphrase.c,v 1.17 2005/05/24 16:09:33 millert Exp $ */ /* * Copyright (c) 2000-2002 Todd C. Miller <Todd.Miller@courtesan.com> @@ -21,7 +21,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.16 2003/06/17 21:56:23 millert Exp $"; +static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.17 2005/05/24 16:09:33 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <ctype.h> @@ -126,8 +126,11 @@ restart: (void)write(output, "\n", 1); /* Restore old terminal settings and signals. */ - if (memcmp(&term, &oterm, sizeof(term)) != 0) - (void)tcsetattr(input, TCSANOW|TCSASOFT, &oterm); + 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); |