From: Joe Orton Date: Thu, 28 Jul 2005 09:40:08 +0000 (+0000) Subject: * modules/ldap/util_ldap.c (LDAP_CACHE_LOCK, LDAP_CACHE_UNLOCK): X-Git-Tag: 2.1.7~5^2~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9afa1542f059764dee8c3e61c3e35e8dd633867a;p=apache * modules/ldap/util_ldap.c (LDAP_CACHE_LOCK, LDAP_CACHE_UNLOCK): Wrap in do/while for safety. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@225732 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 1aead22a41..191af37513 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -91,13 +91,15 @@ static void *util_ldap_create_config(apr_pool_t *p, server_rec *s); "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n" #endif -#define LDAP_CACHE_LOCK() \ - if (st->util_ldap_cache_lock) \ - apr_global_mutex_lock(st->util_ldap_cache_lock) -#define LDAP_CACHE_UNLOCK() \ - if (st->util_ldap_cache_lock) \ - apr_global_mutex_unlock(st->util_ldap_cache_lock) - +#define LDAP_CACHE_LOCK() do { \ + if (st->util_ldap_cache_lock) \ + apr_global_mutex_lock(st->util_ldap_cache_lock); \ +} while (0) + +#define LDAP_CACHE_UNLOCK() do { \ + if (st->util_ldap_cache_lock) \ + apr_global_mutex_unlock(st->util_ldap_cache_lock); \ +} while (0) static void util_ldap_strdup (char **str, const char *newstr) {