trawick 2002/07/11 07:39:04
Modified: include apr_poll.h
poll/unix poll.c
support/unix waitio.c
Log:
get the new poll code to build on AIX, which for 32-bit builds has some
extremely unfortunate macros in <sys/poll.h> that play with "events" and
"revents" via #define
Revision Changes Path
1.2 +2 -2 apr/include/apr_poll.h
Index: apr_poll.h
===================================================================
RCS file: /home/cvs/apr/include/apr_poll.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- apr_poll.h 11 Jul 2002 05:19:44 -0000 1.1
+++ apr_poll.h 11 Jul 2002 14:39:04 -0000 1.2
@@ -108,8 +108,8 @@
struct apr_pollfd_t {
apr_pool_t *p;
apr_datatype_e desc_type;
- apr_int16_t events;
- apr_int16_t revents;
+ apr_int16_t reqevents;
+ apr_int16_t rtnevents;
apr_descriptor desc;
};
1.4 +10 -10 apr/poll/unix/poll.c
Index: poll.c
===================================================================
RCS file: /home/cvs/apr/poll/unix/poll.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- poll.c 11 Jul 2002 14:32:37 -0000 1.3
+++ poll.c 11 Jul 2002 14:39:04 -0000 1.4
@@ -101,7 +101,7 @@
}
curr->desc.s = sock;
curr->desc_type = APR_POLL_SOCKET;
- curr->events = event;
+ curr->reqevents = event;
return APR_SUCCESS;
}
@@ -125,8 +125,8 @@
return APR_NOTFOUND;
}
- if (curr->events & events) {
- curr->events ^= events;
+ if (curr->reqevents & events) {
+ curr->reqevents ^= events;
}
return APR_SUCCESS;
@@ -272,13 +272,13 @@
else if (aprset[i].desc_type == APR_POLL_FILE) {
fd = aprset[i].desc.f->filedes;
}
- if (aprset[i].events & APR_POLLIN) {
+ if (aprset[i].reqevents & APR_POLLIN) {
FD_SET(fd, &readset);
}
- if (aprset[i].events & APR_POLLOUT) {
+ if (aprset[i].reqevents & APR_POLLOUT) {
FD_SET(fd, &writeset);
}
- if (aprset[i].events &
+ if (aprset[i].reqevents &
(APR_POLLPRI | APR_POLLERR | APR_POLLHUP | APR_POLLNVAL)) {
FD_SET(fd, &exceptset);
}
@@ -306,15 +306,15 @@
else if (aprset[i].desc_type == APR_POLL_FILE) {
fd = aprset[i].desc.f->filedes;
}
- aprset[i].revents = 0;
+ aprset[i].rtnevents = 0;
if (FD_ISSET(fd, &readset)) {
- aprset[i].revents |= APR_POLLIN;
+ aprset[i].rtnevents |= APR_POLLIN;
}
if (FD_ISSET(fd, &writeset)) {
- aprset[i].revents |= APR_POLLOUT;
+ aprset[i].rtnevents |= APR_POLLOUT;
}
if (FD_ISSET(fd, &exceptset)) {
- aprset[i].revents |= APR_POLLERR;
+ aprset[i].rtnevents |= APR_POLLERR;
}
}
1.2 +2 -2 apr/support/unix/waitio.c
Index: waitio.c
===================================================================
RCS file: /home/cvs/apr/support/unix/waitio.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- waitio.c 11 Jul 2002 05:19:45 -0000 1.1
+++ waitio.c 11 Jul 2002 14:39:04 -0000 1.2
@@ -85,12 +85,12 @@
pollset.p = s->cntxt;
timeout = s->timeout;
}
- pollset.events = type;
+ pollset.reqevents = type;
do {
srv = apr_poll(&pollset, 1, &n, timeout);
- if (n == 1 && pollset.revents & type) {
+ if (n == 1 && pollset.rtnevents & type) {
return APR_SUCCESS;
}
} while (APR_STATUS_IS_EINTR(srv));