connected = use_hp = 0;
- if ( host != NULL && ( address = inet_addr( host )) == (unsigned long) -1L ) {
+ if ( host != NULL ) {
+ address = inet_addr( host );
+ /* This was just a test for -1 until OSF1 let inet_addr return
+ unsigned int, which is narrower than 'unsigned long address' */
+ if ( address == 0xffffffff || address == (unsigned long) -1 ) {
if ( (hp = gethostbyname( host )) == NULL ) {
#ifdef HAVE_WINSOCK
errno = WSAGetLastError();
return( -1 );
}
use_hp = 1;
+ }
}
rc = -1;
if (( hp = gethostbyaddr( (char *) &sin.sin_addr,
sizeof( sin.sin_addr ), AF_INET )) != NULL ) {
if ( hp->h_name != NULL ) {
- return( strdup( hp->h_name ));
+ return( ldap_strdup( hp->h_name ));
}
}
void *
-ldap_new_select_info()
+ldap_new_select_info( void )
{
struct selectinfo *sip;
tblsize = sysconf( _SC_OPEN_MAX );
#elif defined( HAVE_GETDTABLESIZE )
tblsize = getdtablesize();
+#else
+ tblsize = FD_SETSIZE;
#endif /* !USE_SYSCONF */
#ifdef FD_SETSIZE