diff options
author | monty@hundin.mysql.fi <> | 2001-09-12 23:53:31 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-09-12 23:53:31 +0300 |
commit | 7a1998780596ac62b8fa50a98cc90e1a797da0c9 (patch) | |
tree | 51a09b9e3466647e4386ab24f3c9aa89ff7a93b9 /libmysql/dll.c | |
parent | 46f944f4a43612ec75df32737625a95d01e751e8 (diff) | |
download | mariadb-git-7a1998780596ac62b8fa50a98cc90e1a797da0c9.tar.gz |
OS2 patch
Diffstat (limited to 'libmysql/dll.c')
-rw-r--r-- | libmysql/dll.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libmysql/dll.c b/libmysql/dll.c index 4c952c5889e..d1a23794025 100644 --- a/libmysql/dll.c +++ b/libmysql/dll.c @@ -110,3 +110,25 @@ int _export FAR PASCAL libmain(HANDLE hModule,short cbHeapSize, } #endif + +#ifdef OS2 + +// +// This function is called automatically by _DLL_InitTerm +// Every dll runtime enviroment is not tz enabled, so tzset() +// must be called to enable TZ handling +// Also timezone is fixed. +// +extern "C" unsigned long _System DllMain(unsigned long modhandle, + unsigned long flag) +{ + if (flag == 0) { + tzset(); // Set tzname + time_t currentTime = time(NULL); + struct tm *ts = localtime(¤tTime); + if (ts->tm_isdst > 0) + _timezone -= 3600; + } +} + +#endif |