X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/0d7feb60621ef87da1a5e17c11eea5b5d16ef813..81fa3f37b8b594d312a65c0c5d59687d458d612b:/openbsd-compat/readpassphrase.c diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index b5f4d1ce..11bd8f64 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -1,6 +1,4 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/readpassphrase.c */ - -/* $OpenBSD: readpassphrase.c,v 1.16 2003/06/17 21:56:23 millert Exp $ */ +/* $OpenBSD: readpassphrase.c,v 1.18 2005/08/08 08:05:34 espie Exp $ */ /* * Copyright (c) 2000-2002 Todd C. Miller @@ -22,16 +20,20 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.16 2003/06/17 21:56:23 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ +/* OPENBSD ORIGINAL: lib/libc/gen/readpassphrase.c */ #include "includes.h" #ifndef HAVE_READPASSPHRASE #include +#include +#include +#include #include +#include +#include +#include #ifdef TCSASOFT # define _T_FLUSH (TCSAFLUSH|TCSASOFT) @@ -137,10 +139,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, _T_FLUSH, &oterm) == -1 && + errno == EINTR) + continue; + } (void)sigaction(SIGALRM, &savealrm, NULL); (void)sigaction(SIGHUP, &savehup, NULL); (void)sigaction(SIGINT, &saveint, NULL);