From 0c0fb46dcef6c63c74094486e499e376fdb33a04 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Feb 2023 16:46:46 +0100 Subject: [PATCH] agetty: don't ignore --noclear when re-print issue file 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 --- term-utils/agetty.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 49935c8d95..d8d4f4259f 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -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'; -- 2.47.3