]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
more: do not reset parent process terminal in execute()
authorSami Kerola <kerolasa@iki.fi>
Sat, 21 Mar 2020 12:34:15 +0000 (12:34 +0000)
committerSami Kerola <kerolasa@iki.fi>
Mon, 13 Apr 2020 11:14:07 +0000 (12:14 +0100)
Only the terminal of the child process, that is the command being executed,
needs the reset.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/more.c

index a1b4df7af895cc4f138a2bd724caafebd772bc9d..0b3e838288dde2d6ea5652b19d832b9491ec2de5 100644 (file)
@@ -1095,7 +1095,6 @@ static void execute(struct more_control *ctl, char *filename, char *cmd, ...)
        int argcount;
 
        fflush(stdout);
-       reset_tty(ctl);
        for (n = 10; (id = fork()) < 0 && n > 0; n--)
                sleep(5);
        if (id == 0) {
@@ -1104,6 +1103,7 @@ static void execute(struct more_control *ctl, char *filename, char *cmd, ...)
                        close(STDIN_FILENO);
                        open("/dev/tty", 0);
                }
+               reset_tty(ctl);
 
                va_start(argp, cmd);
                arg = va_arg(argp, char *);