From: Todd C. Miller Date: Tue, 10 Mar 2015 14:55:01 +0000 (-0600) Subject: Use TCSAFLUSH instead of TCSANOW in sudo_term_copy(). X-Git-Tag: SUDO_1_8_13^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef1b2c3bebe544900741e53f18d23844ce94d01a;p=sudo Use TCSAFLUSH instead of TCSANOW in sudo_term_copy(). Be consistent with where we put TCSASOFT in the action flags. --- diff --git a/lib/util/term.c b/lib/util/term.c index c6a339911..d3ee27f52 100644 --- a/lib/util/term.c +++ b/lib/util/term.c @@ -147,7 +147,7 @@ again: #ifdef VSTATUS term.c_cc[VSTATUS] = _POSIX_VDISABLE; #endif - if (tcsetattr_nobg(fd, TCSADRAIN|TCSASOFT, &term) == 0) { + if (tcsetattr_nobg(fd, TCSASOFT|TCSADRAIN, &term) == 0) { changed = 1; debug_return_bool(true); } @@ -181,7 +181,7 @@ again: CLR(term.c_lflag, ECHO | ICANON | ISIG | IEXTEN); if (isig) SET(term.c_lflag, ISIG); - if (tcsetattr_nobg(fd, TCSADRAIN|TCSASOFT, &term) == 0) { + if (tcsetattr_nobg(fd, TCSASOFT|TCSADRAIN, &term) == 0) { changed = 1; debug_return_bool(true); } @@ -216,7 +216,7 @@ again: #ifdef VSTATUS term.c_cc[VSTATUS] = _POSIX_VDISABLE; #endif - if (tcsetattr_nobg(fd, TCSADRAIN|TCSASOFT, &term) == 0) { + if (tcsetattr_nobg(fd, TCSASOFT|TCSADRAIN, &term) == 0) { sudo_term_erase = term.c_cc[VERASE]; sudo_term_kill = term.c_cc[VKILL]; changed = 1; @@ -243,10 +243,10 @@ sudo_term_copy_v1(int src, int dst) again: if (tcgetattr(src, &tt) != 0) debug_return_bool(false); - if (tcsetattr_nobg(dst, TCSANOW|TCSASOFT, &tt) == 0) + if (tcsetattr_nobg(dst, TCSASOFT|TCSAFLUSH, &tt) == 0) debug_return_bool(true); if (got_sigttou) { - /* We were in the background, so oterm is probably bogus. */ + /* We were in the background, so tt is probably bogus. */ kill(getpid(), SIGTTOU); goto again; }