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.
-/* $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
/* 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);