From 2f5c00f2bd13d878197c8fc670ee154d13de8872 Mon Sep 17 00:00:00 2001 From: Jacques de Laval Date: Fri, 4 Jun 2021 13:20:14 +0200 Subject: [PATCH] Also accept \n for "Please press Enter to activate ..." Shouldn't be needed for real cases, but we have seen automated scripts send '\n' instead of '\r', or '\r' + '\n'. Signed-off-by: Jacques de Laval --- src/exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exec.c b/src/exec.c index 2d6a2e70..800d33b1 100644 --- a/src/exec.c +++ b/src/exec.c @@ -307,7 +307,7 @@ static int activate_console(int noclear, int nowait) dprint(STDERR_FILENO, clr, strlen(clr)); dprint(STDERR_FILENO, msg, strlen(msg)); - while ((rc = read(STDIN_FILENO, &c, 1)) > 0 && c != '\r') + while ((rc = read(STDIN_FILENO, &c, 1)) > 0 && c != '\r' && c != '\n') continue; /* On any error (likely EINTR), we avoid starting getty */