Fix syncrepl slapd_shutdown detection, would not stop on a gentlehup.

This commit is contained in:
Howard Chu 2004-01-15 21:35:05 +00:00
parent fc32304934
commit c9d033ae30
3 changed files with 4 additions and 6 deletions

View File

@ -83,9 +83,6 @@ static int waking;
do { if (w) tcp_write( wake_sds[1], "0", 1 ); } while(0) do { if (w) tcp_write( wake_sds[1], "0", 1 ); } while(0)
#endif #endif
#ifndef HAVE_WINSOCK
static
#endif
volatile sig_atomic_t slapd_shutdown = 0, slapd_gentle_shutdown = 0; volatile sig_atomic_t slapd_shutdown = 0, slapd_gentle_shutdown = 0;
volatile sig_atomic_t slapd_abrupt_shutdown = 0; volatile sig_atomic_t slapd_abrupt_shutdown = 0;

View File

@ -419,6 +419,7 @@ LDAP_SLAPD_F (void) slapd_set_read LDAP_P((ber_socket_t s, int wake));
LDAP_SLAPD_F (void) slapd_clr_read LDAP_P((ber_socket_t s, int wake)); LDAP_SLAPD_F (void) slapd_clr_read LDAP_P((ber_socket_t s, int wake));
LDAP_SLAPD_V (volatile sig_atomic_t) slapd_abrupt_shutdown; LDAP_SLAPD_V (volatile sig_atomic_t) slapd_abrupt_shutdown;
LDAP_SLAPD_V (volatile sig_atomic_t) slapd_shutdown;
/* /*
* dn.c * dn.c

View File

@ -450,7 +450,7 @@ do_syncrep2(
BerVarray syncUUIDs = NULL; BerVarray syncUUIDs = NULL;
ber_tag_t si_tag; ber_tag_t si_tag;
if ( slapd_abrupt_shutdown ) { if ( slapd_shutdown ) {
rc = -2; rc = -2;
goto done; goto done;
} }
@ -477,7 +477,7 @@ do_syncrep2(
while (( rc = ldap_result( si->si_ld, LDAP_RES_ANY, LDAP_MSG_ONE, tout_p, &res )) while (( rc = ldap_result( si->si_ld, LDAP_RES_ANY, LDAP_MSG_ONE, tout_p, &res ))
> 0 ) > 0 )
{ {
if ( slapd_abrupt_shutdown ) { if ( slapd_shutdown ) {
rc = -2; rc = -2;
goto done; goto done;
} }
@ -797,7 +797,7 @@ do_syncrepl(
return NULL; return NULL;
} }
if ( slapd_abrupt_shutdown && si->si_ld ) { if ( slapd_shutdown && si->si_ld ) {
ldap_get_option( si->si_ld, LDAP_OPT_DESC, &s ); ldap_get_option( si->si_ld, LDAP_OPT_DESC, &s );
connection_client_stop( s ); connection_client_stop( s );
ldap_unbind( si->si_ld ); ldap_unbind( si->si_ld );