]> granicus.if.org Git - sudo/commitdiff
Use TCSAFLUSH instead of TCSANOW in sudo_term_copy().
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 10 Mar 2015 14:55:01 +0000 (08:55 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 10 Mar 2015 14:55:01 +0000 (08:55 -0600)
Be consistent with where we put TCSASOFT in the action flags.

lib/util/term.c

index c6a33991109cc57147c81b9e16d86e4025d97251..d3ee27f52820fd8438384c6c6dbe6d133df78a60 100644 (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;
     }