From: Derrell Lipman Date: Wed, 13 May 2009 01:32:33 +0000 (-0400) Subject: Fix broken smb_thread_once function (again) X-Git-Tag: tdb-1.1.5~586 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c39e450fc4216e1138e4f30d2c1e2b6ba3854a8;p=thirdparty%2Fsamba.git Fix broken smb_thread_once function (again) - It would help if smb_thread_once did, eventually, set the variable that prevents the init function from being run again. Sigh. It must be getting late. Derrell --- diff --git a/lib/util/smb_threads.c b/lib/util/smb_threads.c index 6f84a2e7476..e2d01f775a4 100644 --- a/lib/util/smb_threads.c +++ b/lib/util/smb_threads.c @@ -121,6 +121,9 @@ int smb_thread_once(smb_thread_once_t *ponce, void (*init_fn)(void)) if (! *ponce) { /* Nope, we need to run the initialization function */ (*init_fn)(); + + /* Now we can indicate that the function has been run */ + *ponce = true; } /* Unlock the mutex */