More fixes for prev commit

This commit is contained in:
Howard Chu 2005-01-21 22:27:24 +00:00
parent 7de2352868
commit 123668e241

View File

@ -57,11 +57,10 @@ static void *do_put(void *ptr)
Entry *e; Entry *e;
int lineno; int lineno;
ldap_pvt_thread_mutex_lock( &put_mutex );
do { do {
ldap_pvt_thread_mutex_lock( &put_mutex );
ldap_pvt_thread_cond_wait( &put_cond, &put_mutex ); ldap_pvt_thread_cond_wait( &put_cond, &put_mutex );
if ( put_rc ) { if ( put_rc ) {
ldap_pvt_thread_mutex_unlock( &put_mutex );
break; break;
} }
@ -77,7 +76,6 @@ static void *do_put(void *ptr)
entry_free( e ); entry_free( e );
if ( continuemode ) continue; if ( continuemode ) continue;
put_rc = EXIT_FAILURE; put_rc = EXIT_FAILURE;
ldap_pvt_thread_mutex_unlock( &put_mutex );
break; break;
} }
} }
@ -93,9 +91,9 @@ static void *do_put(void *ptr)
} }
entry_free( e ); entry_free( e );
ldap_pvt_thread_mutex_unlock( &put_mutex );
} while (1); } while (1);
ldap_pvt_thread_mutex_unlock( &put_mutex );
} }
int int
@ -401,10 +399,12 @@ slapadd( int argc, char **argv )
} }
if ( use_thread ) { if ( use_thread ) {
put_rc = EXIT_FAILURE; if ( !put_rc ) {
ldap_pvt_thread_mutex_lock( &put_mutex ); put_rc = EXIT_FAILURE;
ldap_pvt_thread_cond_signal( &put_cond ); ldap_pvt_thread_mutex_lock( &put_mutex );
ldap_pvt_thread_mutex_unlock( &put_mutex ); ldap_pvt_thread_cond_signal( &put_cond );
ldap_pvt_thread_mutex_unlock( &put_mutex );
}
ldap_pvt_thread_join( put_tid, NULL ); ldap_pvt_thread_join( put_tid, NULL );
} }
@ -412,7 +412,7 @@ slapadd( int argc, char **argv )
bvtext.bv_val = textbuf; bvtext.bv_val = textbuf;
bvtext.bv_val[0] = '\0'; bvtext.bv_val[0] = '\0';
if ( update_ctxcsn && !dryrun && maxcsn.bv_len ) { if ( rc == EXIT_SUCCESS && update_ctxcsn && !dryrun && maxcsn.bv_len ) {
ctxcsn_id = be->be_dn2id_get( be, be->be_nsuffix ); ctxcsn_id = be->be_dn2id_get( be, be->be_nsuffix );
if ( ctxcsn_id == NOID ) { if ( ctxcsn_id == NOID ) {
fprintf( stderr, "%s: context entry is missing\n", progname ); fprintf( stderr, "%s: context entry is missing\n", progname );