mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
Fix braindead signal handling in linux kernal threads.
First version with waiting on int to become 0; should be implemented via conditional variable... Fix of typos. First anchor for new bdb2 backend.
This commit is contained in:
parent
216049bd12
commit
8107ec91f0
@ -163,7 +163,7 @@ ldbm_back_add(
|
||||
0 );
|
||||
next_id_return( be, e->e_id );
|
||||
|
||||
entry_rdwr_unlock(e, 1);;
|
||||
entry_rdwr_unlock(e, 1);
|
||||
entry_free( e );
|
||||
|
||||
send_ldap_result( conn, op, LDAP_ALREADY_EXISTS, "", "" );
|
||||
|
@ -315,6 +315,7 @@ char *derefDN ( Backend *be,
|
||||
}
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "<= returning deref DN of \"%s\"\n", newDN, 0, 0 );
|
||||
if (matched != NULL) free(matched);
|
||||
|
||||
return newDN;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ idl_fetch(
|
||||
idl_free( idl );
|
||||
idl = idl_allids( be );
|
||||
|
||||
return idl;
|
||||
return( idl );
|
||||
}
|
||||
|
||||
if ( ! ID_BLOCK_INDIRECT( idl ) ) {
|
||||
|
@ -40,6 +40,9 @@ static volatile sig_atomic_t slapd_shutdown = 0;
|
||||
static void set_shutdown(int sig);
|
||||
static void do_nothing (int sig);
|
||||
|
||||
int listener_running = 1;
|
||||
|
||||
|
||||
/* a link to the slapd.conf configuration parameters */
|
||||
extern char *slapd_pid_file;
|
||||
extern char *slapd_args_file;
|
||||
@ -390,6 +393,11 @@ slapd_daemon(
|
||||
}
|
||||
ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
|
||||
|
||||
/* a braindead signal handling in LINUX Kernel Threads needs some
|
||||
provision, so that the top thread is not killed before the
|
||||
listener thread (should be better implemented by cond_vars) */
|
||||
listener_running = 0;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
#include "lutil.h" /* Get lutil_detach() */
|
||||
|
||||
|
||||
extern int listener_running;
|
||||
|
||||
/*
|
||||
* when more than one slapd is running on one machine, each one might have
|
||||
* it's own LOCAL for syslogging and must have its own pid/args files
|
||||
@ -172,6 +174,10 @@ main( int argc, char **argv )
|
||||
openlog( serverName, OPENLOG_OPTIONS );
|
||||
#endif
|
||||
|
||||
#ifdef SLAPD_BDB2
|
||||
bdb2i_do_timing = 1;
|
||||
#endif
|
||||
|
||||
if ( slap_init( SLAP_SERVER_MODE, serverName ) != 0 ) {
|
||||
rc = 1;
|
||||
goto destroy;
|
||||
@ -208,7 +214,8 @@ main( int argc, char **argv )
|
||||
} else {
|
||||
|
||||
/* wait for the listener thread to complete */
|
||||
ldap_pvt_thread_join( listener_tid, (void *) NULL );
|
||||
while ( listener_running )
|
||||
ldap_pvt_thread_join( listener_tid, (void *) NULL );
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -22,6 +22,11 @@
|
||||
#define ldap_debug slap_debug
|
||||
#endif
|
||||
|
||||
#ifdef SLAPD_BDB2
|
||||
extern int bdb2i_do_timing;
|
||||
#endif
|
||||
|
||||
|
||||
#include "ldap_log.h"
|
||||
|
||||
#include "../../libraries/liblber/lber-int.h"
|
||||
@ -151,7 +156,7 @@ typedef struct entry {
|
||||
/*
|
||||
* remaining fields require backend cache lock to access
|
||||
* These items are specific to the LDBM backend and should
|
||||
* and should be hidden.
|
||||
* be hidden.
|
||||
*/
|
||||
char e_state; /* for the cache */
|
||||
#define ENTRY_STATE_DELETED 1
|
||||
|
Loading…
Reference in New Issue
Block a user