Add zalloc_or_die()
[privoxy.git] / errlog.c
index f493ac6..6daf818 100644 (file)
--- a/errlog.c
+++ b/errlog.c
@@ -1,4 +1,4 @@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.121 2014/06/03 10:24:00 fabiankeil Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.124 2016/01/21 20:53:01 diem Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.c,v $
@@ -421,12 +421,11 @@ static long get_thread_id(void)
    this_thread = (long)pthread_self();
 #ifdef __MACH__
    /*
-    * Mac OSX (and perhaps other Mach instances) doesn't have a debuggable
-    * value at the first 4 bytes of pthread_self()'s return value, a pthread_t.
-    * pthread_t is supposed to be opaque... but it's fairly random, though, so
-    * we make it mostly presentable.
+    * Mac OSX (and perhaps other Mach instances) doesn't have a unique
+    * value at the lowest order 4 bytes of pthread_self()'s return value, a pthread_t,
+    * so trim the three lowest-order bytes from the value (16^3).
     */
-   this_thread = abs(this_thread % 1000);
+   this_thread = this_thread / 4096;
 #endif /* def __MACH__ */
 #elif defined(_WIN32)
    this_thread = GetCurrentThreadId();