ber_socket_t s,
struct timeval *tvp )
{
- int timeout = INFTIM;
- struct timeval tv = { 0 };
int rc;
- if ( tvp != NULL ) {
- tv = *tvp;
- timeout = TV2MILLISEC( tvp );
- }
osip_debug(ld, "ldap_int_poll: fd: %d tm: %ld\n",
s, tvp ? tvp->tv_sec : -1L, 0);
#ifdef HAVE_POLL
{
struct pollfd fd;
+ int timeout = INFTIM;
fd.fd = s;
fd.events = POLL_WRITE;
+ if ( tvp != NULL ) {
+ timeout = TV2MILLISEC( tvp );
+ }
do {
fd.revents = 0;
rc = poll( &fd, 1, timeout );
#ifdef HAVE_WINSOCK
fd_set efds;
#endif
+ struct timeval tv = { 0 };
#if defined( FD_SETSIZE ) && !defined( HAVE_WINSOCK )
if ( s >= FD_SETSIZE ) {
}
#endif
+ if ( tvp != NULL ) {
+ tv = *tvp;
+ }
+
do {
FD_ZERO(&wfds);
FD_SET(s, &wfds );
return rc;
}
- if ( timeout == 0 && rc == 0 ) {
+ if ( rc == 0 && tvp && tvp->tv_sec == 0 && tvp->tv_usec == 0 ) {
return -2;
}