Browse Source

Resolves: bug 244475
Bug Description: crash at startup with new ldap sdk on 64-bit platform
Reviewed by: nkinder (Thanks!)
Fix Description: Use LBER_SOCKET as the socket type instead of int. There was also a place in ldclt where we were doing the same thing.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no

Rich Megginson 18 years ago
parent
commit
f5ce61231b
2 changed files with 4 additions and 4 deletions
  1. 1 1
      ldap/servers/slapd/conntable.c
  2. 3 3
      ldap/servers/slapd/tools/ldclt/ldapfct.c

+ 1 - 1
ldap/servers/slapd/conntable.c

@@ -62,7 +62,7 @@ connection_table_new(int table_size)
 	 */
 	 */
 	for ( i = 0; i < table_size; i++ )
 	for ( i = 0; i < table_size; i++ )
 	{
 	{
-		int	invalid_socket;
+		LBER_SOCKET invalid_socket;
 		ber_len_t maxbersize = config_get_maxbersize();
 		ber_len_t maxbersize = config_get_maxbersize();
 		/* DBDB---move this out of here once everything works */
 		/* DBDB---move this out of here once everything works */
 		ct->c[i].c_sb = ber_sockbuf_alloc();
 		ct->c[i].c_sb = ber_sockbuf_alloc();

+ 3 - 3
ldap/servers/slapd/tools/ldclt/ldapfct.c

@@ -586,7 +586,7 @@ connectToServer (
 	thread_context	*tttctx)
 	thread_context	*tttctx)
 {
 {
   int	 ret;	/* Return value */
   int	 ret;	/* Return value */
-  int	 fd;	/* LDAP cnx's fd */
+  LBER_SOCKET	 fd;	/* LDAP cnx's fd */
   int	 v2v3;	/* LDAP version used */
   int	 v2v3;	/* LDAP version used */
 
 
   /*
   /*
@@ -623,9 +623,9 @@ connectToServer (
       }
       }
 #endif
 #endif
 #ifdef TRACE_FD_GET_OPTION_BUG
 #ifdef TRACE_FD_GET_OPTION_BUG
-      printf ("ldclt[%d]: T%03d:  fd=%d\n", mctx.pid, tttctx->thrdNum, fd);
+      printf ("ldclt[%d]: T%03d:  fd=%d\n", mctx.pid, tttctx->thrdNum, (int)fd);
 #endif
 #endif
-      if (close (fd) < 0)
+      if (close ((int)fd) < 0)
       {
       {
 	perror ("ldctx");
 	perror ("ldctx");
 	printf ("ldclt[%d]: T%03d: cannot close(fd=%d), error=%d (%s)\n",
 	printf ("ldclt[%d]: T%03d: cannot close(fd=%d), error=%d (%s)\n",