diff options
author | unknown <heikki@donna.mysql.fi> | 2001-05-29 15:07:41 +0300 |
---|---|---|
committer | unknown <heikki@donna.mysql.fi> | 2001-05-29 15:07:41 +0300 |
commit | 34a80e21cfea772d4e0e6966eda074544d2719f3 (patch) | |
tree | 74b8a0e556b86dd710b19ee14156a999b62e4104 /innobase/ut | |
parent | 1b20480fd0171ad674f8bf5069f762d4d4a2dea6 (diff) | |
download | mariadb-git-34a80e21cfea772d4e0e6966eda074544d2719f3.tar.gz |
ut0ut.c If localtime_r not available in Unix, use localtime
configure.in If localtime_r not available in Unix, use localtime
innobase/configure.in:
If localtime_r not available in Unix, use localtime
innobase/ut/ut0ut.c:
If localtime_r not available in Unix, use localtime
Diffstat (limited to 'innobase/ut')
-rw-r--r-- | innobase/ut/ut0ut.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index 07ee3d2b6fe..1436f6a10a3 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -72,19 +72,25 @@ ut_print_timestamp( #else struct tm cal_tm; + struct tm* cal_tm_ptr; time_t tm; time(&tm); +#ifdef HAVE_LOCALTIME_R localtime_r(&tm, &cal_tm); + cal_tm_ptr = &cal_tm; +#else + cal_tm_ptr = localtime(&tm); +#endif fprintf(file,"%02d%02d%02d %2d:%02d:%02d", - cal_tm.tm_year % 100, - cal_tm.tm_mon+1, - cal_tm.tm_mday, - cal_tm.tm_hour, - cal_tm.tm_min, - cal_tm.tm_sec); + cal_tm_ptr->tm_year % 100, + cal_tm_ptr->tm_mon+1, + cal_tm_ptr->tm_mday, + cal_tm_ptr->tm_hour, + cal_tm_ptr->tm_min, + cal_tm_ptr->tm_sec); #endif } |