From df30e1acc83436bddaa61cba47a258d7d69e0f01 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 3 Sep 2004 06:37:15 +0000 Subject: sleep instead of busy waiting on ENOBUFS. reduces cpu time. pr3900. ok canacar@ deraadt@ matthieu@ millert@ --- usr.sbin/pppoe/client.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/pppoe/client.c b/usr.sbin/pppoe/client.c index 284700844b8..689a5078ec4 100644 --- a/usr.sbin/pppoe/client.c +++ b/usr.sbin/pppoe/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.19 2004/06/14 19:22:39 canacar Exp $ */ +/* $OpenBSD: client.c,v 1.20 2004/09/03 06:37:14 tedu Exp $ */ /* * Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net @@ -368,8 +368,10 @@ getpackets(int bfd, u_int8_t *srv, u_int8_t *sysname, goto next; if ((r = bpf_to_ppp(pppfd, len, mpkt)) < 0) return (-1); - if (r == 0) + if (r == 0) { + usleep(100000); continue; + } } next: pkt += BPF_WORDALIGN(bh->bh_hdrlen + bh->bh_caplen); -- cgit v1.2.3