diff --git a/lib/pty-session.c b/lib/pty-session.c index 4cf29d6dd..6d8ba4eb7 100644 --- a/lib/pty-session.c +++ b/lib/pty-session.c @@ -631,6 +631,12 @@ int ul_pty_proxy_master(struct ul_pty *pty) break; } + if (rc && pty->child && pty->child != (pid_t) -1 && !pty->delivered_signal) { + kill(pty->child, SIGTERM); + sleep(2); + kill(pty->child, SIGKILL); + } + pty_signals_cleanup(pty); DBG(IO, ul_debug("poll() done [signal=%d, rc=%d]", pty->delivered_signal, rc)); diff --git a/term-utils/script.c b/term-utils/script.c index c7f3250de..0a12dda4f 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -673,7 +673,6 @@ static int callback_log_stream_activity(void *data, int fd, char *buf, size_t bu ctl->outsz += ssz; - /* check output limit */ if (ctl->maxsz != 0 && ctl->outsz >= ctl->maxsz) { if (!ctl->quiet)