]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/dnssrv.c
ITS#6437 cleanup (noop change): Compute pad,order_start at compile time
[openldap] / libraries / libldap / dnssrv.c
index c7a22401a248cee47698dd11a52359525ad43c22..16b15447cac2bfefc717104998aa5b065cb6fb87 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2007 The OpenLDAP Foundation.
+ * Copyright 1998-2011 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -202,9 +202,7 @@ int ldap_domain2hostlist(
     }
     sprintf(request, "_ldap._tcp.%s", domain);
 
-#ifdef LDAP_R_COMPILE
-    ldap_pvt_thread_mutex_lock(&ldap_int_resolv_mutex);
-#endif
+    LDAP_MUTEX_LOCK(&ldap_int_resolv_mutex);
 
     rc = LDAP_UNAVAILABLE;
 #ifdef NS_HFIXEDSZ
@@ -289,7 +287,7 @@ int ldap_domain2hostlist(
                    /* not first time around */
                    hostlist[cur++] = ' ';
                }
-               cur += sprintf(&hostlist[cur], "%s:%hd", host, port);
+               cur += sprintf(&hostlist[cur], "%s:%hu", host, port);
            }
 add_size:;
            p += size;
@@ -305,9 +303,7 @@ add_size:;
        *list = hostlist;
 
   out:
-#ifdef LDAP_R_COMPILE
-    ldap_pvt_thread_mutex_unlock(&ldap_int_resolv_mutex);
-#endif
+    LDAP_MUTEX_UNLOCK(&ldap_int_resolv_mutex);
 
     if (request != NULL) {
        LDAP_FREE(request);