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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user