summaryrefslogtreecommitdiff
path: root/openbsd-compat/readpassphrase.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/readpassphrase.c')
-rw-r--r--openbsd-compat/readpassphrase.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c
index 10f0e0ed3..8e5785520 100644
--- a/openbsd-compat/readpassphrase.c
+++ b/openbsd-compat/readpassphrase.c
@@ -51,7 +51,9 @@ readpassphrase(prompt, buf, bufsiz, flags)
51{ 51{
52 struct termios term; 52 struct termios term;
53 char ch, *p, *end; 53 char ch, *p, *end;
54#ifdef _POSIX_VDISABLE
54 u_char status; 55 u_char status;
56#endif
55 int echo, input, output; 57 int echo, input, output;
56 sigset_t oset, nset; 58 sigset_t oset, nset;
57 59
@@ -86,7 +88,9 @@ readpassphrase(prompt, buf, bufsiz, flags)
86 88
87 /* Turn off echo if possible. */ 89 /* Turn off echo if possible. */
88 echo = 0; 90 echo = 0;
91#ifdef _POSIX_VDISABLE
89 status = _POSIX_VDISABLE; 92 status = _POSIX_VDISABLE;
93#endif
90 if (tcgetattr(input, &term) == 0) { 94 if (tcgetattr(input, &term) == 0) {
91 if (!(flags & RPP_ECHO_ON) && (term.c_lflag & ECHO)) { 95 if (!(flags & RPP_ECHO_ON) && (term.c_lflag & ECHO)) {
92 echo = 1; 96 echo = 1;
@@ -124,7 +128,11 @@ readpassphrase(prompt, buf, bufsiz, flags)
124 } 128 }
125 } 129 }
126 *p = '\0'; 130 *p = '\0';
131#ifdef _POSIX_VDISABLE
127 if (echo || status != _POSIX_VDISABLE) { 132 if (echo || status != _POSIX_VDISABLE) {
133#else
134 if (echo) {
135#endif
128 if (echo) { 136 if (echo) {
129 (void)write(output, "\n", 1); 137 (void)write(output, "\n", 1);
130 term.c_lflag |= ECHO; 138 term.c_lflag |= ECHO;