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.
This commit is contained in:
miod 2022-06-27 20:22:26 +00:00
parent b5445af285
commit b83d90f0d5
1 changed files with 3 additions and 7 deletions

View File

@ -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);