[openssh-commits] [openssh] 01/03: If we don't have TCSASOFT, define it to zero.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Oct 13 04:11:20 AEDT 2016


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 7508d83eff89af069760b4cc587305588a64e415
Author: Darren Tucker <dtucker at zip.com.au>
Date:   Thu Oct 13 03:53:51 2016 +1100

    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.
---
 openbsd-compat/readpassphrase.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c
index d63cdf2..81c4c2f 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;
 	}

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list