summaryrefslogtreecommitdiff
path: root/time/unix/time.c
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2001-06-22 17:53:49 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2001-06-22 17:53:49 +0000
commit88fa09a888a35330af6e3cde8cd276535f002e59 (patch)
treef26014113679ff763300df5af1d0c856a4b878eb /time/unix/time.c
parent48dcb3713061a225e10344cfa76664ae4ae9df99 (diff)
downloadlibapr-88fa09a888a35330af6e3cde8cd276535f002e59.tar.gz
Solaris doesn't have (struct tm *)->tm_gmtoff, so the server logs
were written in GMT regardess of the system timezone. (The well-known Solaris headache) The Solaris-kludge did exist and worked in 2.0.16 of srclib/apr/time/unix/time.c:apr_explode_localtime(), but the code was moved from apr_explode_localtime() to set_xt_gmtoff_from_tm() around version 1.38. So the attached patch will use tm_to_exp() (which calls set_xt_gmtoff_from_tm()) in apr_explode_localtime(), which fixed the problem. PR: 7902 Submitted by: Taketo Kabe <kabe@sra-tohoku.co.jp> Reviewed by: Jeff Trawick git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61793 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'time/unix/time.c')
-rw-r--r--time/unix/time.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/time/unix/time.c b/time/unix/time.c
index 743a9f21d..bac305139 100644
--- a/time/unix/time.c
+++ b/time/unix/time.c
@@ -154,25 +154,16 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input
return apr_explode_time(result, input, -timezone);
#else
time_t mango = input / APR_USEC_PER_SEC;
- apr_int32_t offs = 0;
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
struct tm mangotm;
localtime_r(&mango, &mangotm);
-/* XXX - Add support for Solaris */
-#ifdef HAVE_GMTOFF
- offs = mangotm.tm_gmtoff;
-#elif defined(HAVE___OFFSET)
- offs = mangotm.__tm_gmtoff;
-#endif
#else /* !APR_HAS_THREADS */
- struct tm *mangotm;
- mangotm=localtime(&mango);
-#ifdef HAVE_GMTOFF
- offs = mangotm->tm_gmtoff;
-#endif
+ struct tm mangotm;
+ mangotm = *localtime(&mango);
#endif
- return apr_explode_time(result, input, offs);
+ tm_to_exp(result, &mangotm, &mango);
+ return APR_SUCCESS;
#endif /* __EMX__ */
}