]> granicus.if.org Git - apache/commitdiff
* modules/ldap/util_ldap.c (LDAP_CACHE_LOCK, LDAP_CACHE_UNLOCK):
authorJoe Orton <jorton@apache.org>
Thu, 28 Jul 2005 09:40:08 +0000 (09:40 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 28 Jul 2005 09:40:08 +0000 (09:40 +0000)
Wrap in do/while for safety.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@225732 13f79535-47bb-0310-9956-ffa450edef68

modules/ldap/util_ldap.c

index 1aead22a411990cc1f6d7583a39215ea036f8699..191af375131901d784b6c537b88d35b1c5191845 100644 (file)
@@ -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)
 {