loader: Print autoboot countdown immediately, not at 9

For the first second otime and ntime are equal so no message gets
printed. Instead we should print the countdown right from the start,
although we do it at the end of the first iteration so that if a key has
already been pressed then the message is suppressed.

Reviewed by:	imp
Approved by:	imp
Differential Revision:	https://reviews.freebsd.org/D26935
This commit is contained in:
Jessica Clarke 2020-12-14 00:46:24 +00:00
parent 0066de1c4b
commit c46f7610d4

View File

@ -202,8 +202,9 @@ autoboot(int timeout, char *prompt)
}
if (timeout >= 0) {
otime = time(NULL);
when = otime + timeout; /* when to boot */
otime = -1;
ntime = time(NULL);
when = ntime + timeout; /* when to boot */
yes = 0;