]> git.sur5r.net Git - openldap/commitdiff
Fix syncrepl slapd_shutdown detection, would not stop on a gentlehup.
authorHoward Chu <hyc@openldap.org>
Thu, 15 Jan 2004 21:35:05 +0000 (21:35 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 15 Jan 2004 21:35:05 +0000 (21:35 +0000)
servers/slapd/daemon.c
servers/slapd/proto-slap.h
servers/slapd/syncrepl.c

index d98ca7fe7bf6cf0bcf73086c104aa870fad1d359..97556de00e0aa2ccae56dde3a0cf399c7f184b60 100644 (file)
@@ -83,9 +83,6 @@ static int waking;
 do { if (w) tcp_write( wake_sds[1], "0", 1 ); } while(0)
 #endif
 
-#ifndef HAVE_WINSOCK
-static
-#endif
 volatile sig_atomic_t slapd_shutdown = 0, slapd_gentle_shutdown = 0;
 volatile sig_atomic_t slapd_abrupt_shutdown = 0;
 
index b081f58ef6f24671459684ae9aa812055dc9e70e..11556fc0b79ab9b3acefe92c9df9ebd12f65d3d1 100644 (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_V (volatile sig_atomic_t) slapd_abrupt_shutdown;
+LDAP_SLAPD_V (volatile sig_atomic_t) slapd_shutdown;
 
 /*
  * dn.c
index 2a8a7b1e886bd0452662cd62664ff47faf65a15b..a77e2c6bcb4dd822456bf8047da1b47ddc0f458f 100644 (file)
@@ -450,7 +450,7 @@ do_syncrep2(
        BerVarray syncUUIDs = NULL;
        ber_tag_t si_tag;
 
-       if ( slapd_abrupt_shutdown ) {
+       if ( slapd_shutdown ) {
                rc = -2;
                goto done;
        }
@@ -477,7 +477,7 @@ do_syncrep2(
        while (( rc = ldap_result( si->si_ld, LDAP_RES_ANY, LDAP_MSG_ONE, tout_p, &res ))
                > 0 )
        {
-               if ( slapd_abrupt_shutdown ) {
+               if ( slapd_shutdown ) {
                        rc = -2;
                        goto done;
                }
@@ -797,7 +797,7 @@ do_syncrepl(
                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 );
                connection_client_stop( s );
                ldap_unbind( si->si_ld );