[systemd-devel] [PATCH 1/2] ptyfwd: Set the size of the PTY base on the size of stdout, not stdin.

Lennart Poettering lennart at poettering.net
Tue Dec 10 17:02:51 PST 2013


On Sat, 23.11.13 04:57, Luke Shumaker (LukeShu at sbcglobal.net) wrote:

Looks good. I figure the window size is a property of the output, not
the output, so this looks right. Applied!

> ---
>  src/shared/ptyfwd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c
> index 7225b93..85a0ddc 100644
> --- a/src/shared/ptyfwd.c
> +++ b/src/shared/ptyfwd.c
> @@ -305,7 +305,7 @@ static int process_pty_loop(int master, sigset_t *mask, pid_t kill_pid, int sign
>                                          struct winsize ws;
>  
>                                          /* The window size changed, let's forward that. */
> -                                        if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) >= 0)
> +                                        if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) >= 0)
>                                                  ioctl(master, TIOCSWINSZ, &ws);
>  
>                                  } else if (sfsi.ssi_signo == SIGTERM && kill_pid > 0 && signo > 0 && !tried_orderly_shutdown) {
> @@ -346,7 +346,7 @@ int process_pty(int master, sigset_t *mask, pid_t kill_pid, int signo) {
>          struct winsize ws;
>          int r;
>  
> -        if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) >= 0)
> +        if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) >= 0)
>                  ioctl(master, TIOCSWINSZ, &ws);
>  
>          if (tcgetattr(STDIN_FILENO, &saved_attr) >= 0) {


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list