Don't generate SIGTOU when restoring the terminal modes. It doen't
make sense to suspend the process only to restore the terminal settings since in this case the shell has already taken ownership of the tty.
This commit is contained in:
@@ -197,17 +197,8 @@ restore:
|
|||||||
|
|
||||||
/* Restore old tty settings. */
|
/* Restore old tty settings. */
|
||||||
if (!ISSET(flags, TGP_ECHO)) {
|
if (!ISSET(flags, TGP_ECHO)) {
|
||||||
for (;;) {
|
|
||||||
/* Restore old tty settings if possible. */
|
/* Restore old tty settings if possible. */
|
||||||
if (sudo_term_restore(input, true) || errno != EINTR)
|
(void) sudo_term_restore(input, true);
|
||||||
break;
|
|
||||||
/* Received SIGTTOU, suspend the process. */
|
|
||||||
signo[SIGTTOU] = 0;
|
|
||||||
if (suspend(SIGTTOU, callback) == -1) {
|
|
||||||
pass = NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (input != STDIN_FILENO)
|
if (input != STDIN_FILENO)
|
||||||
(void) close(input);
|
(void) close(input);
|
||||||
|
Reference in New Issue
Block a user