瀏覽代碼

Merge remote-tracking branch 'origin/maint-0.2.6'

Nick Mathewson 9 年之前
父節點
當前提交
2bfdfc849b
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 4 0
      changes/bug9495_redux
  2. 5 1
      src/common/compat_pthreads.c

+ 4 - 0
changes/bug9495_redux

@@ -0,0 +1,4 @@
+  o Major bugfixes (portability):
+    - Do not crash on startup when running on Solaris. Fixes a bug
+      related to our fix for 9495; bugfix on 0.2.6.1-alpha. Reported
+      by "ruebezahl".

+ 5 - 1
src/common/compat_pthreads.c

@@ -279,7 +279,11 @@ tor_threads_init(void)
     pthread_mutexattr_init(&attr_recursive);
     pthread_mutexattr_settype(&attr_recursive, PTHREAD_MUTEX_RECURSIVE);
     tor_assert(0==pthread_attr_init(&attr_detached));
-    tor_assert(0==pthread_attr_setdetachstate(&attr_detached, 1));
+#ifndef PTHREAD_CREATE_DETACHED
+#define PTHREAD_CREATE_DETACHED 1
+#endif
+    tor_assert(0==pthread_attr_setdetachstate(&attr_detached,
+                                              PTHREAD_CREATE_DETACHED));
     threads_initialized = 1;
     set_main_thread();
   }