diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2022-06-27 20:22:27 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2022-06-27 20:22:27 +0000 |
commit | bad4873353f7ecba272d8b261c330d259ad60ff9 (patch) | |
tree | 84efa0158f55fa8a62c0fe61cabb721cd084c8a5 | |
parent | c06ec31651ae8bb377436828e4be5374c0f7d76b (diff) |
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.
-rw-r--r-- | sys/stand/boot/cmd.c | 10 |
1 files 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); |