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 <Jacques.De.Laval@westermo.com>
This commit is contained in:
Jacques de Laval
2021-06-04 13:20:14 +02:00
parent dc36b313ff
commit 2f5c00f2bd
+1 -1
View File
@@ -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 */