2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 22:35:10 +00:00

Use TCSAFLUSH instead of TCSANOW in sudo_term_copy().

Be consistent with where we put TCSASOFT in the action flags.
This commit is contained in:
Todd C. Miller
2015-03-10 08:55:01 -06:00
parent 0600a0d0a9
commit ef1b2c3beb

View File

@@ -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;
}