X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fos-local.c;h=4e3a19e5a29c20fa0fe19f1f73195f1996890230;hb=de01a6e3d791d3458549d2ceeccf4d7e0477ff78;hp=1079c5071363bc55423acb732f0abf2a8b16067d;hpb=9129a2f7eeb1d82b4d4de7fed0bf2b3472193879;p=openldap diff --git a/libraries/libldap/os-local.c b/libraries/libldap/os-local.c index 1079c50713..4e3a19e5a2 100644 --- a/libraries/libldap/os-local.c +++ b/libraries/libldap/os-local.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * 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 @@ -155,9 +155,10 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s) #undef TRACE #if !defined(HAVE_GETPEEREID) && \ + !defined(HAVE_GETPEERUCRED) && \ !defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && \ - defined(HAVE_SENDMSG) && (defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS) || \ - defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)) + defined(HAVE_SENDMSG) && (defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTSLEN) || \ + defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)) #define DO_SENDMSG static const char abandonPDU[] = {LDAP_TAG_MESSAGE, 6, LDAP_TAG_MSGID, 1, 0, LDAP_REQ_ABANDON, 1, 0}; @@ -167,12 +168,11 @@ static int 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",