/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#undef TRACE
#if !defined(HAVE_GETPEEREID) && \
+ !defined(HAVE_GETPEERUCRED) && \
!defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && \
defined(HAVE_SENDMSG) && (defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTSLEN) || \
defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL))
ldap_pvt_connect(LDAP *ld, ber_socket_t s, struct sockaddr_un *sa, int async)
{
int rc;
- struct timeval tv = { 0 },
- *opt_tv = NULL;
+ struct timeval tv, *opt_tv = NULL;
- opt_tv = ld->ld_options.ldo_tm_net;
- if ( opt_tv != NULL ) {
- tv = *opt_tv;
+ if ( ld->ld_options.ldo_tm_net.tv_sec >= 0 ) {
+ tv = ld->ld_options.ldo_tm_net;
+ opt_tv = &tv;
}
oslocal_debug(ld, "ldap_connect_timeout: fd: %d tm: %ld async: %d\n",