]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: don't ignore --noclear when re-print issue file
authorKarel Zak <kzak@redhat.com>
Thu, 2 Feb 2023 15:46:46 +0000 (16:46 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 2 Feb 2023 15:46:46 +0000 (16:46 +0100)
The system network interface changes generate events that may force
agetty to re-print the issue file. The options --noclear should be
ignored in this case.

Fixes: https://github.com/util-linux/util-linux/issues/2051
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.c

index 49935c8d9520e514abe91b8721eadc90bdfe3aac..d8d4f4259fa6d1ea85eafb2bf919a240f98444be 100644 (file)
@@ -2074,7 +2074,8 @@ again:
                if (!wait_for_term_input(STDIN_FILENO)) {
                        eval_issue_file(ie, op, tp);
                        if (issue_is_changed(ie)) {
-                               if (op->flags & F_VCONSOLE)
+                               if ((op->flags & F_VCONSOLE)
+                                   && (op->flags & F_NOCLEAR) == 0)
                                        termio_clear(STDOUT_FILENO);
                                goto again;
                        }
@@ -2216,7 +2217,8 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t
                        if (!issue_is_changed(ie))
                                goto no_reload;
                        tcflush(STDIN_FILENO, TCIFLUSH);
-                       if (op->flags & F_VCONSOLE)
+                       if ((op->flags & F_VCONSOLE)
+                           && (op->flags & F_NOCLEAR) == 0)
                                termio_clear(STDOUT_FILENO);
                        bp = logname;
                        *bp = '\0';