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 | |
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')
-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 d63cdf2f..81c4c2fa 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -35,10 +35,9 @@ #include <string.h> #include <unistd.h> -#ifdef TCSASOFT -# define _T_FLUSH (TCSAFLUSH|TCSASOFT) -#else -# define _T_FLUSH (TCSAFLUSH) +#ifndef TCSASOFT +/* If we don't have TCSASOFT define it so that ORing it it below is a no-op. */ +# define TCSASOFT 0 #endif /* SunOS 4.x which lacks _POSIX_VDISABLE, but has VDISABLE */ @@ -121,7 +120,7 @@ restart: if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) term.c_cc[VSTATUS] = _POSIX_VDISABLE; #endif - (void)tcsetattr(input, _T_FLUSH, &term); + (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); } else { memset(&term, 0, sizeof(term)); term.c_lflag |= ECHO; @@ -156,7 +155,7 @@ restart: /* Restore old terminal settings and signals. */ if (memcmp(&term, &oterm, sizeof(term)) != 0) { - while (tcsetattr(input, _T_FLUSH, &oterm) == -1 && + while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 && errno == EINTR) continue; } |