dns: Use new DNS debugclass in DNS server
[kai/samba.git] / source4 / heimdal / base / heimbase.c
index 137129abb2e99245a8c721c86017137242371e9c..7031af9e49806ad7a483d57d66053ce0c7de4515 100644 (file)
@@ -60,6 +60,10 @@ struct heim_base_mem {
 #define PTR2BASE(ptr) (((struct heim_base *)ptr) - 1)
 #define BASE2PTR(ptr) ((void *)(((struct heim_base *)ptr) + 1))
 
+#ifdef HEIM_BASE_NEED_ATOMIC_MUTEX
+HEIMDAL_MUTEX _heim_base_mutex = HEIMDAL_MUTEX_INITIALIZER;
+#endif
+
 /*
  * Auto release structure
  */
@@ -155,8 +159,6 @@ _heim_get_isa(heim_object_t ptr)
     if (heim_base_is_tagged(ptr)) {
        if (heim_base_is_tagged_object(ptr))
            return tagged_isa[heim_base_tagged_object_tid(ptr)];
-       if (heim_base_is_tagged_string(ptr))
-           return &_heim_string_object;
        heim_abort("not a supported tagged type");
     }
     p = PTR2BASE(ptr);
@@ -334,6 +336,8 @@ heim_base_once_f(heim_base_once_t *once, void *ctx, void (*func)(void *))
     } else {
        HEIMDAL_MUTEX_unlock(&mutex);
        while (1) {
+           struct timeval tv = { 0, 1000 };
+           select(0, NULL, NULL, NULL, &tv);
            HEIMDAL_MUTEX_lock(&mutex);
            if (*once == 2)
                break;
@@ -364,13 +368,10 @@ heim_abort(const char *fmt, ...)
 void
 heim_abortv(const char *fmt, va_list ap)
 {
-    char *str = NULL;
-    int ret;
+    static char str[1024];
 
-    ret = vasprintf(&str, fmt, ap);
-    if (ret > 0 && str) {
-       syslog(LOG_ERR, "heim_abort: %s", str);
-    }
+    vsnprintf(str, sizeof(str), fmt, ap);
+    syslog(LOG_ERR, "heim_abort: %s", str);
     abort();
 }