Author: rjung
Date: Thu Jan 3 02:48:05 2008
New Revision: 608434
URL: http://svn.apache.org/viewvc?rev=608434&view=rev
Log:
Use thread safe localtime_r where appropriate.
Modified:
tomcat/connectors/trunk/jk/native/common/jk_util.c
tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
Modified: tomcat/connectors/trunk/jk/native/common/jk_util.c
URL:
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.c?rev=608434&r1=608433&r2=608434&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.c Thu Jan 3 02:48:05 2008
@@ -436,6 +436,9 @@
{
time_t t;
struct tm *tms;
+#ifdef _MT_CODE_PTHREAD
+ struct tm res;
+#endif
int done;
/* We want to use a fixed maximum size buffer here.
* If we would dynamically adjust it to the real format
@@ -488,7 +491,11 @@
#else
t = time(NULL);
#endif
+#ifdef _MT_CODE_PTHREAD
+ tms = localtime_r(&t, &res);
+#else
tms = localtime(&t);
+#endif
if (log_fmt[0])
done = (int)strftime(str, len, log_fmt, tms);
else
Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=608434&r1=608433&r2=608434&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Thu Jan 3
02:48:05 2008
@@ -44,6 +44,9 @@
<subsection name="Native">
<changelog>
<fix>
+ Use thread safe localtime_r where appropriate. (rjung)
+ </fix>
+ <fix>
Use thread safe strtok_r on more platforms, especially AIX. (rjung)
</fix>
<update>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]