[tor-commits] [torsocks/osx] Do our best to ensure tsocks_init is called only once.

hoganrobert at torproject.org hoganrobert at torproject.org
Sun Oct 23 18:27:12 UTC 2011


commit 8829590838478cd68b7893ec5e67f350fc081cab
Author: Robert Hogan <robert at webkit.org>
Date:   Sun Jun 20 13:11:53 2010 +0100

    Do our best to ensure tsocks_init is called only once.
---
 src/tsocks.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/tsocks.c b/src/tsocks.c
index d76808c..dbda0f9 100644
--- a/src/tsocks.c
+++ b/src/tsocks.c
@@ -176,6 +176,10 @@ void tsocks_init(void) {
       return;
     }
 
+    /* Not strictly true yet, but prevents us getting called while still in progress.*/
+    /* This has been observed on Snow Leopard for instance. */
+    tsocks_init_complete = 1;
+
 #ifdef USE_OLD_DLSYM
     void *lib;
 #endif
@@ -260,7 +264,6 @@ void tsocks_init(void) {
        area won't be shared across fork()s. */
     deadpool_init();
 #endif
-    tsocks_init_complete=1;
 }
 
 static int get_environment() {





More information about the tor-commits mailing list