# define AC_SOCKET_INVALID ((unsigned int) ~0)
#define EWOULDBLOCK WSAEWOULDBLOCK
+#define EINPROGRESS WSAEINPROGRESS
+#define ETIMEDOUT WSAETIMEDOUT
#elif MACOS
# define tcp_close( s ) tcpclose( s )
#else
{
ioctl_t status = 1;
- return ioctl( fd, FIONBIO, (caddr_t)&status );
+ return ioctl( fd, FIONBIO, &status );
}
#endif
return 0;
#else
{
ioctl_t status = 0;
- return ioctl( fd, FIONBIO, (caddr_t)&status );
+ return ioctl( fd, FIONBIO, &status );
}
#endif
}
#ifdef TCP_NODELAY
{
int dummy = 1;
- if ( setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,&dummy,sizeof(dummy)) == -1 )
+ if ( setsockopt( fd, IPPROTO_TCP, TCP_NODELAY, (char*) &dummy, sizeof(dummy) ) == -1 )
return -1;
}
#endif
}
static int
-ldap_pvt_connect(LDAP *ld, int s, struct sockaddr_in *sin, int async)
+ldap_pvt_connect(LDAP *ld, ber_socket_t s, struct sockaddr_in *sin, int async)
{
struct timeval tv, *opt_tv=NULL;
fd_set wfds, *z=NULL;
ldap_pvt_set_errno( WSAGetLastError() );
#endif
- if ( (errno != EINPROGRESS) && (errno != EWOULDBLOCK) )
+ if ( errno != EINPROGRESS && errno != EWOULDBLOCK ) {
return ( -1 );
+ }
#ifdef notyet
if ( async ) return ( -2 );
#endif
- FD_ZERO(&wfds); FD_SET(s, &wfds );
+ FD_ZERO(&wfds);
+ FD_SET(s, &wfds );
if ( select(s + 1, z, &wfds, z, opt_tv ? &tv : NULL) == -1)
return ( -1 );