diff options
author | Hartmut Brandt <harti@FreeBSD.org> | 2018-07-03 08:44:40 +0000 |
---|---|---|
committer | Hartmut Brandt <harti@FreeBSD.org> | 2018-07-03 08:44:40 +0000 |
commit | 8e9b3e707151d136ec95e7f1d37556e39c1e228c (patch) | |
tree | 0bf4cf04b0aa2c25155c8b45a1704512517c9127 /contrib/libbegemot/rpoll.c | |
parent | 4dc1b29b7169560aa0a16bb3488dac17325767f0 (diff) | |
download | src-8e9b3e707151d136ec95e7f1d37556e39c1e228c.tar.gz src-8e9b3e707151d136ec95e7f1d37556e39c1e228c.zip |
Update bsnmp to version 1.13. This does not bring user-visible changes.
For developers gensnmptree can now generate functions for enums to convert
between enums and strings and to check the validity of a value.
The sources in FreeBSD are now in sync with the upstream which allows to
bring in IPv6 modifications.
Notes
Notes:
svn path=/head/; revision=335885
Diffstat (limited to 'contrib/libbegemot/rpoll.c')
-rw-r--r-- | contrib/libbegemot/rpoll.c | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/contrib/libbegemot/rpoll.c b/contrib/libbegemot/rpoll.c index 408635e01799..c61b84057eba 100644 --- a/contrib/libbegemot/rpoll.c +++ b/contrib/libbegemot/rpoll.c @@ -44,17 +44,6 @@ # include <unistd.h> # include <sys/time.h> -/* - * There happens to be linuxes which read siginfo.h when including - * signal.h, which, for no appearent reason, defines these symbols. - */ -# ifdef POLL_IN -# undef POLL_IN -# endif -# ifdef POLL_OUT -# undef POLL_OUT -# endif - # include "rpoll.h" /* @@ -339,11 +328,11 @@ poll_build(void) if(p->fd >= 0) { f->fd = p->fd; f->events = 0; - if(p->mask & POLL_IN) + if(p->mask & RPOLL_IN) f->events |= poll_in; - if(p->mask & POLL_OUT) + if(p->mask & RPOLL_OUT) f->events |= poll_out; - if(p->mask & POLL_EXCEPT) + if(p->mask & RPOLL_EXCEPT) f->events |= poll_except; f->revents = 0; p->pfd = f++; @@ -360,11 +349,11 @@ poll_build(void) if(p->fd >= 0) { if(p->fd > maxfd) maxfd = p->fd; - if(p->mask & POLL_IN) + if(p->mask & RPOLL_IN) FD_SET(p->fd, &rset); - if(p->mask & POLL_OUT) + if(p->mask & RPOLL_OUT) FD_SET(p->fd, &wset); - if(p->mask & POLL_EXCEPT) + if(p->mask & RPOLL_EXCEPT) FD_SET(p->fd, &xset); } # endif @@ -582,27 +571,27 @@ poll_dispatch(int wait) # ifdef USE_POLL if(regs[idx].pfd) { - if ((regs[idx].mask & POLL_IN) && + if ((regs[idx].mask & RPOLL_IN) && (regs[idx].pfd->revents & poll_in)) - mask |= POLL_IN; - if ((regs[idx].mask & POLL_OUT) && + mask |= RPOLL_IN; + if ((regs[idx].mask & RPOLL_OUT) && (regs[idx].pfd->revents & poll_out)) - mask |= POLL_OUT; - if((regs[idx].mask & POLL_EXCEPT) && + mask |= RPOLL_OUT; + if((regs[idx].mask & RPOLL_EXCEPT) && (regs[idx].pfd->revents & poll_except)) - mask |= POLL_EXCEPT; + mask |= RPOLL_EXCEPT; } # endif # ifdef USE_SELECT - if ((regs[idx].mask & POLL_IN) && + if ((regs[idx].mask & RPOLL_IN) && FD_ISSET(regs[idx].fd, &nrset)) - mask |= POLL_IN; - if ((regs[idx].mask & POLL_OUT) && + mask |= RPOLL_IN; + if ((regs[idx].mask & RPOLL_OUT) && FD_ISSET(regs[idx].fd, &nwset)) - mask |= POLL_OUT; - if ((regs[idx].mask & POLL_EXCEPT) && + mask |= RPOLL_OUT; + if ((regs[idx].mask & RPOLL_EXCEPT) && FD_ISSET(regs[idx].fd, &nxset)) - mask |= POLL_EXCEPT; + mask |= RPOLL_EXCEPT; # endif assert(idx < regs_alloc); @@ -723,7 +712,7 @@ main(int argc, char *argv[]) { argv = argv; gettimeofday(&start, NULL); - poll_register(0, infunc, NULL, POLL_IN); + poll_register(0, infunc, NULL, RPOLL_IN); if (argc < 2) { t0 = poll_start_timer(1000, 1, tfunc0, "1 second"); |