From 8829590838478cd68b7893ec5e67f350fc081cab Mon Sep 17 00:00:00 2001 From: Robert Hogan Date: Sun, 20 Jun 2010 13:11:53 +0100 Subject: Do our best to ensure tsocks_init is called only once. --- src/tsocks.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() { -- cgit v1.2.1