Commit: 1340c787af495bada5f91ec17dfcf14afb2c583d
Parent: c1479b5678b632e5545fe2b97b66fa1dab2ae245
Author: Michael Forney
Date: Sun, 26 Feb 2017 17:01:33 -0800
readpassphrase: Support systems without VSTATUS and TCSASOFT
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/compat/readpassphrase.c b/compat/readpassphrase.c
@@ -32,6 +32,10 @@
#include <unistd.h>
#include <readpassphrase.h>
+#ifndef TCSASOFT
+#define TCSASOFT 0
+#endif
+
static volatile sig_atomic_t signo[_NSIG];
static void handler(int);
@@ -81,8 +85,10 @@ restart:
memcpy(&term, &oterm, sizeof(term));
if (!(flags & RPP_ECHO_ON))
term.c_lflag &= ~(ECHO | ECHONL);
+#ifdef VSTATUS
if (term.c_cc[VSTATUS] != _POSIX_VDISABLE)
term.c_cc[VSTATUS] = _POSIX_VDISABLE;
+#endif
(void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term);
} else {
memset(&term, 0, sizeof(term));