/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2009 The OpenLDAP Foundation.
+ * Copyright 1998-2011 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
msg.msg_accrights = (char *)fds;
msg.msg_accrightslen = sizeof(int);
# endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */
- getpeername( s, sa, &salen );
+ getpeername( s, (struct sockaddr *) sa, &salen );
fchmod( fds[0], S_ISUID|S_IRWXU );
write( fds[1], sa, salen );
sendmsg( s, &msg, 0 );
oslocal_debug(ld, "ldap_connect_to_path\n",0,0,0);
- s = ldap_pvt_socket( ld );
- if ( s == AC_SOCKET_INVALID ) {
- return -1;
- }
-
if ( path == NULL || path[0] == '\0' ) {
path = LDAPI_SOCK;
} else {
}
}
+ s = ldap_pvt_socket( ld );
+ if ( s == AC_SOCKET_INVALID ) {
+ return -1;
+ }
+
oslocal_debug(ld, "ldap_connect_to_path: Trying %s\n", path, 0, 0);
memset( &server, '\0', sizeof(server) );
rc = ldap_pvt_connect(ld, s, &server, async);
if (rc == 0) {
- int err;
- err = ldap_int_connect_cbs( ld, sb, &s, srv, (struct sockaddr *)&server );
- if ( err )
- rc = err;
+ rc = ldap_int_connect_cbs( ld, sb, &s, srv, (struct sockaddr *)&server );
}
if ( rc ) {
ldap_pvt_close_socket(ld, s);