Created
June 29, 2015 01:50
-
-
Save cubicdaiya/b1de08a3e2cd061df7a1 to your computer and use it in GitHub Desktop.
no tm.tm_gmtoff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/common/time.c b/lib/common/time.c | |
index 5308848..dab3c24 100644 | |
--- a/lib/common/time.c | |
+++ b/lib/common/time.c | |
@@ -139,7 +139,11 @@ void h2o_time2str_log(char *buf, time_t time) | |
{ | |
struct tm localt; | |
localtime_r(&time, &localt); | |
+#if HAVE_TM_GMTOFF | |
int gmt_off = (int)(localt.tm_gmtoff / 60); | |
+#else | |
+ int gmt_off = (int)(- (localt.tm_isdst ? timezone + 3600 : timezone) / 60); | |
+#endif /* HAVE_TM_GMTOFF */ | |
int gmt_sign; | |
if (gmt_off >= 0) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment