diff options
author | brian <brian@FreeBSD.org> | 1998-06-24 19:33:36 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1998-06-24 19:33:36 +0000 |
commit | 7c567ca3f8ef3ab5a1e088fbf86a9b1cd2e6718e (patch) | |
tree | cb27c2021e7933ab6a8a0c8a33e27883241617a8 /usr.sbin/ppp/bundle.c | |
parent | be4ceaedbf3a7a77628a0d38a412cd66fbcab341 (diff) | |
download | FreeBSD-src-7c567ca3f8ef3ab5a1e088fbf86a9b1cd2e6718e.zip FreeBSD-src-7c567ca3f8ef3ab5a1e088fbf86a9b1cd2e6718e.tar.gz |
o If we come out of select() with only write descriptors that
end up writing zero bytes, sleep for 1/10 of a second so that
we don't end up using up too much cpu.
This should only ever happen on systems that wrongly report a
descriptor as writable despite the tty buffer being full.
Discussed with: Jeff Evarts
o Do an initial run-time check to see if select() alters the passed
timeval. This knowledge isn't yet used, but will be soon.
Diffstat (limited to 'usr.sbin/ppp/bundle.c')
-rw-r--r-- | usr.sbin/ppp/bundle.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index 49ba4de..d5ae0d5 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.c,v 1.21 1998/06/20 00:19:32 brian Exp $ + * $Id: bundle.c,v 1.22 1998/06/20 01:36:38 brian Exp $ */ #include <sys/param.h> @@ -679,11 +679,12 @@ bundle_DescriptorRead(struct descriptor *d, struct bundle *bundle, } } -static void +static int bundle_DescriptorWrite(struct descriptor *d, struct bundle *bundle, const fd_set *fdset) { struct datalink *dl; + int result = 0; /* This is not actually necessary as struct mpserver doesn't Write() */ if (descriptor_IsSet(&bundle->ncp.mp.server.desc, fdset)) @@ -691,7 +692,9 @@ bundle_DescriptorWrite(struct descriptor *d, struct bundle *bundle, for (dl = bundle->links; dl; dl = dl->next) if (descriptor_IsSet(&dl->desc, fdset)) - descriptor_Write(&dl->desc, bundle, fdset); + result += descriptor_Write(&dl->desc, bundle, fdset); + + return result; } void |