summaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorBradley Nicholes <bnicholes@apache.org>2001-11-05 20:02:58 +0000
committerBradley Nicholes <bnicholes@apache.org>2001-11-05 20:02:58 +0000
commitfcb1b1fc1659c876bf628a24833938d48fbe58b8 (patch)
tree97a76966ce3314056f09d2fe9e0b694ac67bed81 /time
parentff25ce8d6f237ca1ff90ac3bf69961af0739b28d (diff)
downloadapr-fcb1b1fc1659c876bf628a24833938d48fbe58b8.tar.gz
Added an initialization routine for NetWare and daylight savings handling
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62490 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'time')
-rw-r--r--time/unix/time.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/time/unix/time.c b/time/unix/time.c
index 463101127..f81d62680 100644
--- a/time/unix/time.c
+++ b/time/unix/time.c
@@ -84,6 +84,15 @@ static apr_int32_t get_offset(struct tm *tm)
#elif defined(HAVE___OFFSET)
return tm->__tm_gmtoff;
#else
+#ifdef NETWARE
+ /* Need to adjust the global variable each time otherwise
+ the web server would have to be restarted when daylight
+ savings changes.
+ */
+ if (daylightOnOff) {
+ return server_gmt_offset + daylightOffset;
+ }
+#endif
return server_gmt_offset;
#endif
}
@@ -156,7 +165,7 @@ APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result, apr_time_
APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input)
{
-#if defined(__EMX__) || defined(NETWARE)
+#if defined(__EMX__)
/* EMX gcc (OS/2) has a timezone global we can use */
return apr_explode_time(result, input, -timezone);
#else
@@ -342,3 +351,11 @@ APR_DECLARE(void) apr_unix_setup_time(void)
server_gmt_offset = (apr_int32_t) difftime(t1, t2) + (was_dst ? 3600 : 0);
#endif
}
+
+#ifdef NETWARE
+APR_DECLARE(void) apr_netware_setup_time(void)
+{
+ tzset();
+ server_gmt_offset = -timezone;
+}
+#endif