From: Karel Zak Date: Thu, 2 Feb 2023 15:46:46 +0000 (+0100) Subject: agetty: don't ignore --noclear when re-print issue file X-Git-Tag: v2.39-rc1~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c0fb46dcef6c63c74094486e499e376fdb33a04;p=thirdparty%2Futil-linux.git 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 --- 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';