diff options
author | Darren Tucker <dtucker@zip.com.au> | 2016-10-13 03:53:51 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2016-10-13 03:53:51 +1100 |
commit | 7508d83eff89af069760b4cc587305588a64e415 (patch) | |
tree | 58dd46653ede4a24f1cdf3e5f075f95d95b86d8b /openbsd-compat/readpassphrase.c | |
parent | aae4dbd4c058d3b1fe1eb5c4e6ddf35827271377 (diff) |
If we don't have TCSASOFT, define it to zero.
This makes it a no-op when we use it below, which allows us to re-sync
those lines with the upstream and make future updates easier.
Diffstat (limited to 'openbsd-compat/readpassphrase.c')
-rw-r--r-- | openbsd-compat/readpassphrase.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index d63cdf2f0..81c4c2fa1 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c | |||
@@ -35,10 +35,9 @@ | |||
35 | #include <string.h> | 35 | #include <string.h> |
36 | #include <unistd.h> | 36 | #include <unistd.h> |
37 | 37 | ||
38 | #ifdef TCSASOFT | 38 | #ifndef TCSASOFT |
39 | # define _T_FLUSH (TCSAFLUSH|TCSASOFT) | 39 | /* If we don't have TCSASOFT define it so that ORing it it below is a no-op. */ |
40 | #else | 40 | # define TCSASOFT 0 |
41 | # define _T_FLUSH (TCSAFLUSH) | ||
42 | #endif | 41 | #endif |
43 | 42 | ||
44 | /* SunOS 4.x which lacks _POSIX_VDISABLE, but has VDISABLE */ | 43 | /* SunOS 4.x which lacks _POSIX_VDISABLE, but has VDISABLE */ |
@@ -121,7 +120,7 @@ restart: | |||
121 | if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) | 120 | if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) |
122 | term.c_cc[VSTATUS] = _POSIX_VDISABLE; | 121 | term.c_cc[VSTATUS] = _POSIX_VDISABLE; |
123 | #endif | 122 | #endif |
124 | (void)tcsetattr(input, _T_FLUSH, &term); | 123 | (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); |
125 | } else { | 124 | } else { |
126 | memset(&term, 0, sizeof(term)); | 125 | memset(&term, 0, sizeof(term)); |
127 | term.c_lflag |= ECHO; | 126 | term.c_lflag |= ECHO; |
@@ -156,7 +155,7 @@ restart: | |||
156 | 155 | ||
157 | /* Restore old terminal settings and signals. */ | 156 | /* Restore old terminal settings and signals. */ |
158 | if (memcmp(&term, &oterm, sizeof(term)) != 0) { | 157 | if (memcmp(&term, &oterm, sizeof(term)) != 0) { |
159 | while (tcsetattr(input, _T_FLUSH, &oterm) == -1 && | 158 | while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 && |
160 | errno == EINTR) | 159 | errno == EINTR) |
161 | continue; | 160 | continue; |
162 | } | 161 | } |