if( opt_tv != NULL ) timeout = TV2MILLISEC( &tv );
fd.fd = s;
- fd.events = POLLOUT;
+ fd.events = POLLWRITE;
do {
fd.revents = 0;
if( rc == AC_SOCKET_ERROR ) return rc;
- if( fd.revents & POLLOUT ) {
+ if( fd.revents & POLLWRITE ) {
if ( ldap_pvt_is_socket_ready(ld, s) == -1 ) return -1;
if ( ldap_pvt_ndelay_off(ld, s) == -1 ) return -1;
return ( 0 );
/* for UNIX poll(2) */
int si_maxfd;
struct pollfd si_fds[FD_SETSIZE];
+#undef POLLOTHER
+#define POLLOTHER (POLLERR|POLLHUP)
+#undef POLLREAD
+#define POLLREAD (POLLIN|POLLPRI|POLLOTHER)
+#undef POLLWRITE
+#define POLLWRITE (POLLOUT|POLLOTHER)
#else
/* for UNIX select(2) */
fd_set si_readfds;
int i;
for(i=0; i < sip->si_maxfd; i++) {
if( sip->si_fds[i].fd == sd ) {
- sip->si_fds[i].events |= POLLIN;
+ sip->si_fds[i].events |= POLLWRITE;
return;
}
if( empty==-1 && sip->si_fds[i].fd == -1 ) {
}
sip->si_fds[empty].fd = sd;
- sip->si_fds[empty].events = POLLOUT;
+ sip->si_fds[empty].events = POLLWRITE;
}
#else
/* for UNIX select(2) */
int i;
for(i=0; i < sip->si_maxfd; i++) {
if( sip->si_fds[i].fd == sd ) {
- sip->si_fds[i].events |= POLLIN;
+ sip->si_fds[i].events |= POLLREAD;
return;
}
if( empty==-1 && sip->si_fds[i].fd == -1 ) {
}
sip->si_fds[empty].fd = sd;
- sip->si_fds[empty].events = POLLIN;
+ sip->si_fds[empty].events = POLLREAD;
}
#else
/* for UNIX select(2) */
int i;
for(i=0; i < sip->si_maxfd; i++) {
if( sip->si_fds[i].fd == sd ) {
- return sip->si_fds[i].revents & POLLOUT;
+ return sip->si_fds[i].revents & POLLWRITE;
}
}
int i;
for(i=0; i < sip->si_maxfd; i++) {
if( sip->si_fds[i].fd == sd ) {
- return sip->si_fds[i].revents & POLLIN;
+ return sip->si_fds[i].revents & POLLREAD;
}
}