]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#1033 slapd hangs with GNU Pth - don't write to the wakefd
authorHoward Chu <hyc@openldap.org>
Sat, 21 Sep 2002 03:52:16 +0000 (03:52 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 21 Sep 2002 03:52:16 +0000 (03:52 +0000)
more than once at any given time.

servers/slapd/daemon.c

index 151b6d395bf7e0d37125859d9d238c7899f71cc8..94de3b729be2005a2f551732437bbecf899d152e 100644 (file)
@@ -49,7 +49,7 @@ Listener **slap_listeners = NULL;
 
 static ber_socket_t wake_sds[2];
 
-#ifdef NO_THREADS
+#if defined(NO_THREADS) || defined(HAVE_GNU_PTH)
 static int waking;
 #define WAKE_LISTENER(w) \
 ((w && !waking) ? tcp_write( wake_sds[1], "0", 1 ), waking=1 : 0)
@@ -1315,7 +1315,7 @@ slapd_daemon_task(
                if( FD_ISSET( wake_sds[0], &readfds ) ) {
                        char c[BUFSIZ];
                        tcp_read( wake_sds[0], c, sizeof(c) );
-#ifdef NO_THREADS
+#if defined(NO_THREADS) || defined(HAVE_GNU_PTH)
                        waking = 0;
 #endif
                        continue;