From: Mark Valence Date: Thu, 9 Dec 1999 22:05:00 +0000 (+0000) Subject: On Windows, WSAENOTSOCK is treated the same as EBADF. This is needed because of... X-Git-Tag: UCDATA_2_4~113 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=31eea5f43c95d7c4c69455bd501b14b6aaee925a;p=openldap 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. --- 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 ) {