]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Wall: Fix terminal flag usage
authorKarel Zak <kzak@redhat.com>
Thu, 6 Jun 2024 07:36:28 +0000 (09:36 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 Jun 2024 07:36:34 +0000 (09:36 +0200)
.
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/scriptreplay.c

index a2afd1c86d728f6e5eb69aca1a0dacbbce40465f..1453d5bbbb718bc3db324129008734ada862c79b 100644 (file)
@@ -132,7 +132,7 @@ setterm(struct termios *backup, int *saved_flag)
        *saved_flag = fcntl(STDIN_FILENO, F_GETFL);
        if (*saved_flag == -1)
                err(EXIT_FAILURE, _("unexpected fcntl failure"));
-       fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK);
+       fcntl(STDIN_FILENO, F_SETFL, *saved_flag | O_NONBLOCK);
 
        if (tcgetattr(STDOUT_FILENO, backup) != 0) {
                if (errno != ENOTTY) /* For debugger. */