Do not need the opost flag to term_copy() now that we use pipes for
stdout/stderr when they are not a tty.
This commit is contained in:
@@ -197,7 +197,7 @@ check_foreground(void)
|
||||
{
|
||||
foreground = tcgetpgrp(script_fds[SFD_USERTTY]) == ppgrp;
|
||||
if (foreground && !tty_initialized) {
|
||||
if (term_copy(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE], ttyout)) {
|
||||
if (term_copy(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE])) {
|
||||
tty_initialized = 1;
|
||||
sync_ttysize(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE]);
|
||||
}
|
||||
@@ -476,7 +476,7 @@ script_execve(struct command_details *details, char *argv[], char *envp[],
|
||||
|
||||
if (foreground) {
|
||||
/* Copy terminal attrs from user tty -> pty slave. */
|
||||
if (term_copy(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE], ttyout)) {
|
||||
if (term_copy(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE])) {
|
||||
tty_initialized = 1;
|
||||
sync_ttysize(script_fds[SFD_USERTTY], script_fds[SFD_SLAVE]);
|
||||
}
|
||||
|
@@ -176,7 +176,7 @@ void script_setup(uid_t);
|
||||
|
||||
/* term.c */
|
||||
int term_cbreak(int);
|
||||
int term_copy(int, int, int);
|
||||
int term_copy(int, int);
|
||||
int term_noecho(int);
|
||||
int term_raw(int, int, int);
|
||||
int term_restore(int, int);
|
||||
|
@@ -164,15 +164,12 @@ term_cbreak(int fd)
|
||||
}
|
||||
|
||||
int
|
||||
term_copy(int src, int dst, int opost)
|
||||
term_copy(int src, int dst)
|
||||
{
|
||||
struct termios tt;
|
||||
|
||||
if (tcgetattr(src, &tt) != 0)
|
||||
return(0);
|
||||
/* Do not do post-processing unless opost set. */
|
||||
if (!opost)
|
||||
CLR(tt.c_oflag, OPOST);
|
||||
/* XXX - add TCSANOW compat define */
|
||||
if (tcsetattr(dst, TCSANOW|TCSASOFT, &tt) != 0)
|
||||
return(0);
|
||||
|
Reference in New Issue
Block a user