From 31eea5f43c95d7c4c69455bd501b14b6aaee925a Mon Sep 17 00:00:00 2001 From: Mark Valence Date: Thu, 9 Dec 1999 22:05:00 +0000 Subject: [PATCH] On Windows, WSAENOTSOCK is treated the same as EBADF. This is needed because of a race condition (sock is selected just after another thread closes it), which needs a proper fix. --- servers/slapd/daemon.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 823e6bd0b3..f49a339689 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -569,8 +569,13 @@ slapd_daemon_task( case -1: { /* failure - try again */ int err = sock_errno(); - if( err == EBADF && ++ebadf < SLAPD_EBADF_LIMIT) { - continue; + if( err == EBADF +#ifdef HAVE_WINSOCK + || err == WSAENOTSOCK /* you'd think this would be EBADF */ +#endif + ) { + if (++ebadf < SLAPD_EBADF_LIMIT) + continue; } if( err != EINTR ) { -- 2.39.5