List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:September 1 2008 4:28pm
Subject:bzr commit into mysql-5.1 branch (vvaintroub:2728)
View as plain text  
#At file:///C:/bzr/bt51/

 2728 Vladislav Vaintroub	2008-09-01 [merge]
      merge
modified:
  libmysql/dll.c

=== modified file 'libmysql/dll.c'
--- a/libmysql/dll.c	2008-02-19 17:45:11 +0000
+++ b/libmysql/dll.c	2008-09-01 16:28:11 +0000
@@ -89,9 +89,20 @@ BOOL APIENTRY LibMain(HANDLE hInst,DWORD
   UNREFERENCED_PARAMETER(lpReserved);
 } /* LibMain */
 
+
+static BOOL do_libmain;
 int __stdcall DllMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserved)
 {
-  return LibMain(hInst,ul_reason_being_called,lpReserved);
+  /*
+    Unless environment variable LIBMYSQL_DLLINIT is set, do nothing.
+    The environment variable is checked once, during the first call to DllMain()
+    (in DLL_PROCESS_ATTACH hook).
+  */
+  if (ul_reason_being_called == DLL_PROCESS_ATTACH)
+    do_libmain = (getenv("LIBMYSQL_DLLINIT") != NULL);
+  if (do_libmain)
+    return LibMain(hInst,ul_reason_being_called,lpReserved);
+  return TRUE;
 }
 
 #elif defined(WINDOWS)

Thread
bzr commit into mysql-5.1 branch (vvaintroub:2728) Vladislav Vaintroub1 Sep