diff options
author | Brian Somers <brian@FreeBSD.org> | 1998-02-13 05:10:26 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1998-02-13 05:10:26 +0000 |
commit | b6dec9f07f112fcc0ffbfaf32cfb0b817239f331 (patch) | |
tree | 5a98fab000b8a68f99744e65b879d14a434d3fa4 /usr.sbin/ppp/physical.c | |
parent | 6b5fb63d1e5a57b7dfbba894125c5e932db59247 (diff) | |
download | src-test2-b6dec9f07f112fcc0ffbfaf32cfb0b817239f331.tar.gz src-test2-b6dec9f07f112fcc0ffbfaf32cfb0b817239f331.zip |
Notes
Diffstat (limited to 'usr.sbin/ppp/physical.c')
-rw-r--r-- | usr.sbin/ppp/physical.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c index 3cdf43c04fc2..41e3bd0b0be8 100644 --- a/usr.sbin/ppp/physical.c +++ b/usr.sbin/ppp/physical.c @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: physical.c,v 1.1.2.6 1998/02/09 19:21:07 brian Exp $ + * $Id: physical.c,v 1.1.2.7 1998/02/10 03:22:02 brian Exp $ * */ @@ -179,25 +179,30 @@ Physical_ReportProtocolStatus(struct cmdargs const *arg) int Physical_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, - int *n) + int *n, int force) { struct physical *p = descriptor2physical(d); int sets; LogPrintf(LogDEBUG, "descriptor2physical; %p -> %p\n", d, p); + sets = 0; if (p->fd >= 0) { - if (*n < p->fd + 1) - *n = p->fd + 1; - FD_SET(p->fd, r); - FD_SET(p->fd, e); - if (link_QueueLen(&p->link)) { + if (r) { + FD_SET(p->fd, r); + sets++; + } + if (e) { + FD_SET(p->fd, e); + sets++; + } + if (w && (force || link_QueueLen(&p->link))) { FD_SET(p->fd, w); - sets = 3; - } else - sets = 2; - } else - sets = 0; + sets++; + } + if (sets && *n < p->fd + 1) + *n = p->fd + 1; + } return sets; } |