/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2013 The OpenLDAP Foundation.
+ * Copyright 1998-2017 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Debug( LDAP_DEBUG_TRACE, "ldap_result ld %p msgid %d\n", (void *)ld, msgid, 0 );
+ if (ld->ld_errno == LDAP_LOCAL_ERROR || ld->ld_errno == LDAP_SERVER_DOWN)
+ return -1;
+
LDAP_MUTEX_LOCK( &ld->ld_res_mutex );
rc = wait4msg( ld, msgid, all, timeout, result );
LDAP_MUTEX_UNLOCK( &ld->ld_res_mutex );
#ifdef HAVE_GETTIMEOFDAY
gettimeofday( &start_time_tv, NULL );
#else /* ! HAVE_GETTIMEOFDAY */
- time( &start_time_tv.tv_sec );
+ start_time_tv.tv_sec = time( NULL );
start_time_tv.tv_usec = 0;
#endif /* ! HAVE_GETTIMEOFDAY */
}
#ifdef HAVE_GETTIMEOFDAY
gettimeofday( &curr_time_tv, NULL );
#else /* ! HAVE_GETTIMEOFDAY */
- time( &curr_time_tv.tv_sec );
+ curr_time_tv.tv_sec = time( NULL );
curr_time_tv.tv_usec = 0;
#endif /* ! HAVE_GETTIMEOFDAY */