Mainly updated back-bdb2, back-passwd, back-shell to use slap_get_time().
ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
/* check time limit */
- ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
- time( ¤ttime );
- if ( tlimit != -1 && currenttime > stoptime ) {
- ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
+ if ( tlimit != -1 && slap_get_time() > stoptime ) {
send_ldap_search_result( conn, op,
LDAP_TIMELIMIT_EXCEEDED, NULL, nrefs > 0 ? rbuf :
NULL, nentries );
}
return( 0 );
}
- ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
/* get the entry with reader lock */
if ( (e = bdb2i_id2entry_r( be, id )) == NULL ) {
logsize = forced ? (u_int32_t) 0 : txn_max_pending_log;
mins = forced ? (u_int32_t) 0 : txn_max_pending_time;
- ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
- time( ¤ttime );
- now = currenttime;
- ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
+ slap_set_time();
+ now = slap_get_time();
rc = txn_checkpoint( txmgr, logsize, mins );
ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
/* check time limit */
- ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
- time( ¤ttime );
- if ( currenttime > stoptime ) {
- ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
+ if ( slap_get_time() > stoptime ) {
send_ldap_result( conn, op, LDAP_TIMELIMIT_EXCEEDED,
NULL, NULL );
endpwent();
return( 0 );
}
- ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
e = pw2entry( be, pw );
/* no abandon command defined - just kill the process handling it */
if ( si->si_abandon == NULL ) {
- ldap_pvt_thread_mutex_lock( &conn->c_opsmutex );
+ ldap_pvt_thread_mutex_lock( &conn->c_mutex );
pid = -1;
for ( o = conn->c_ops; o != NULL; o = o->o_next ) {
if ( o->o_msgid == msgid ) {
break;
}
}
- ldap_pvt_thread_mutex_unlock( &conn->c_opsmutex );
+ if( pid == -1 ) {
+ for ( o = conn->c_pending_ops; o != NULL; o = o->o_next ) {
+ if ( o->o_msgid == msgid ) {
+ pid = (pid_t) o->o_private;
+ break;
+ }
+ }
+ }
+ ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
if ( pid != -1 ) {
Debug( LDAP_DEBUG_ARGS, "shell killing pid %d\n", pid,
/* FALL THRU */
}
- slap_set_time();
-
if ( FD_ISSET( tcps, &readfds ) ) {
int s;
int len = sizeof(from);
static char* slap_name;
int slapMode = SLAP_UNDEFINED_MODE;
-static time_t currenttime;
static ldap_pvt_thread_mutex_t currenttime_mutex;
int
}
/* should create a utils.c for these */
-
-void slap_set_time(void)
-{
- ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
- time( ¤ttime );
- ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
-}
-
time_t slap_get_time(void)
{
time_t t;
ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
- t = currenttime;
+ time( &t );
ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
return t;
}
extern time_t starttime;
time_t slap_get_time LDAP_P((void));
-void slap_set_time LDAP_P((void));
extern ldap_pvt_thread_mutex_t active_threads_mutex;
extern ldap_pvt_thread_cond_t active_threads_cond;
#include "../slap.h"
+/* bogus ../results.c */
+int str2result(
+ char* s,
+ int *code,
+ char **matched,
+ char **info )
+{
+ assert(0);
+}
+
void
send_ldap_result(
Connection *conn,
BUILD_BDB2 = @BUILD_BDB2@
test-bdb2: FORCE
+ @-$(LN_S) $(srcdir)/data .
@if test "$(BUILD_BDB2)" = "yes" ; then \
- $(LN_S) $(srcdir)/data . ; \
echo "Initiating LDAP tests..." ; \
$(MKDIR) test-db test-repl ; \
$(srcdir)/scripts/all $(srcdir) bdb2 ; \