summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hash.c6
-rw-r--r--internal/time.h1
-rw-r--r--time.c6
3 files changed, 10 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index 32df430b6d..8eb07a54dd 100644
--- a/hash.c
+++ b/hash.c
@@ -35,6 +35,7 @@
#include "internal/object.h"
#include "internal/proc.h"
#include "internal/symbol.h"
+#include "internal/time.h"
#include "internal/vm.h"
#include "probes.h"
#include "ruby/st.h"
@@ -4758,7 +4759,6 @@ env_str_new2(const char *ptr)
}
static const char TZ_ENV[] = "TZ";
-extern bool ruby_tz_uptodate_p;
static rb_encoding *
env_encoding_for(const char *name, const char *ptr)
@@ -4843,7 +4843,7 @@ env_delete(VALUE name)
* This hack might works only on Linux glibc.
*/
if (ENVMATCH(nam, TZ_ENV)) {
- ruby_tz_uptodate_p = FALSE;
+ ruby_reset_timezone();
}
if (val) {
@@ -5275,7 +5275,7 @@ env_aset(VALUE nm, VALUE val)
RB_GC_GUARD(nm);
}
else if (ENVMATCH(name, TZ_ENV)) {
- ruby_tz_uptodate_p = FALSE;
+ ruby_reset_timezone();
}
return val;
}
diff --git a/internal/time.h b/internal/time.h
index ef3d64e967..8f84899221 100644
--- a/internal/time.h
+++ b/internal/time.h
@@ -29,6 +29,7 @@ struct timeval rb_time_timeval(VALUE);
RUBY_SYMBOL_EXPORT_BEGIN
/* time.c (export) */
void ruby_reset_leap_second_info(void);
+void ruby_reset_timezone(void);
RUBY_SYMBOL_EXPORT_END
#endif /* INTERNAL_TIME_H */
diff --git a/time.c b/time.c
index b5d1aee375..7339547527 100644
--- a/time.c
+++ b/time.c
@@ -683,6 +683,12 @@ static VALUE tm_from_time(VALUE klass, VALUE time);
bool ruby_tz_uptodate_p;
+void
+ruby_reset_timezone(void)
+{
+ ruby_tz_uptodate_p = false;
+}
+
static void
update_tz(void)
{