summaryrefslogtreecommitdiffstats
path: root/strftime.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-20 17:08:36 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-20 17:08:36 +0000
commitcf83cd0a5911736492441365216a4aa9e72727f4 (patch)
tree233ff2b2b64203a75303c77abc4f44d88afefa36 /strftime.c
parent7eb3e74e9aa13178b3077088eed91af7c7fd669d (diff)
downloadruby-cf83cd0a5911736492441365216a4aa9e72727f4.tar.gz
ruby-cf83cd0a5911736492441365216a4aa9e72727f4.tar.xz
ruby-cf83cd0a5911736492441365216a4aa9e72727f4.zip
* configure.in: always check timezone().
* strftime.c (rb_strftime): prefer timezone/altzone rather than gettimeofday(). The second argument to gettimeofday() is ignored on Solaris. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/strftime.c b/strftime.c
index f2cfea69e..86284191c 100644
--- a/strftime.c
+++ b/strftime.c
@@ -420,18 +420,18 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
*/
off = timeptr->tm_gmtoff / 60;
#else /* !HAVE_TM_ZONE */
-#ifdef HAVE_GETTIMEOFDAY
- gettimeofday(&tv, &zone);
- off = -zone.tz_minuteswest;
-#else
#if HAVE_VAR_TIMEZONE
#if HAVE_VAR_ALTZONE
off = -(daylight ? timezone : altzone) / 60;
#else
off = -timezone / 60;
#endif
+#else /* !HAVE_TIMEZONE */
+#ifdef HAVE_GETTIMEOFDAY
+ gettimeofday(&tv, &zone);
+ off = -zone.tz_minuteswest;
#endif
-#endif
+#endif /* !HAVE_TIMEZONE */
#endif /* !HAVE_TM_ZONE */
#endif /* !HAVE_TM_NAME */
if (off < 0) {