From b83d90f0d5e8a270c46d6c99c6609668bd21a378 Mon Sep 17 00:00:00 2001 From: miod Date: Mon, 27 Jun 2022 20:22:26 +0000 Subject: [PATCH] Revert 1.44; that slow getsecs() workaround had been added for the sake of an i386 system noone remembers details about and which is unlikely to be relevant those days, and has been found to misbehave on some modern systems, such as the OnLogic Helix 500, or RPi4 with glass console. --- sys/stand/boot/cmd.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sys/stand/boot/cmd.c b/sys/stand/boot/cmd.c index b11f454a6bb..c11c7e9f204 100644 --- a/sys/stand/boot/cmd.c +++ b/sys/stand/boot/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.68 2021/10/24 17:49:19 deraadt Exp $ */ +/* $OpenBSD: cmd.c,v 1.69 2022/06/27 20:22:26 miod Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -248,17 +248,13 @@ readline(char *buf, size_t n, int to) /* Only do timeout if greater than 0 */ if (to > 0) { - u_long i = 0; time_t tt = getsecs() + to; #ifdef DEBUG if (debug > 2) printf ("readline: timeout(%d) at %u\n", to, tt); #endif - /* check for timeout expiration less often - (for some very constrained archs) */ - while (!cnischar()) - if (!(i++ % 1000) && (getsecs() >= tt)) - break; + while (!cnischar() && getsecs() < tt) + continue; if (!cnischar()) { strlcpy(buf, "boot", 5);