From f51306571eea382d8ed3c93c78097b81a2305f1d Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Fri, 13 Feb 2009 03:35:39 +0000
Subject: [PATCH] More for ITS#5886

---
 servers/slapd/daemon.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c
index ddea122b54..fe87e196a4 100644
--- a/servers/slapd/daemon.c
+++ b/servers/slapd/daemon.c
@@ -2545,12 +2545,14 @@ slapd_daemon_task(
 				} else if ( !w ) {
 					Debug( LDAP_DEBUG_CONNS,
 						"daemon: hangup on %d\n", fd, 0, 0 );
+					if ( SLAP_SOCK_IS_ACTIVE( fd )) {
 #ifdef HAVE_EPOLL
-					/* Don't keep reporting the hangup
-					 */
-					SLAP_EPOLL_SOCK_SET( fd, EPOLLET );
+						/* Don't keep reporting the hangup
+						 */
+						SLAP_EPOLL_SOCK_SET( fd, EPOLLET );
 #endif
-					connection_hangup( fd );
+						connection_hangup( fd );
+					}
 				}
 			}
 		}
-- 
GitLab