Reduce a number of getsecs() calls in le_get() to make netboot a bit faster.
This commit is contained in:
parent
c5a81b561e
commit
18864e9474
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_le.c,v 1.11 2009/01/12 11:32:43 tsutsui Exp $ */
|
/* $NetBSD: if_le.c,v 1.12 2014/05/01 18:08:47 tsutsui Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1993 Adam Glass
|
* Copyright (c) 1993 Adam Glass
|
||||||
|
@ -631,10 +631,9 @@ le_get(struct iodesc *desc, void *pkt, size_t len, saseconds_t timeout)
|
||||||
int cc;
|
int cc;
|
||||||
|
|
||||||
t = getsecs();
|
t = getsecs();
|
||||||
cc = 0;
|
do {
|
||||||
while (((getsecs() - t) < timeout) && !cc) {
|
|
||||||
cc = le_poll(desc, pkt, len);
|
cc = le_poll(desc, pkt, len);
|
||||||
}
|
} while (cc == 0 && (getsecs() - t) < timeout);
|
||||||
return cc;
|
return cc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue