From 65337c5b2d56c70440f1677f2b175270d77ea0d1 Mon Sep 17 00:00:00 2001 From: shugo Date: Wed, 20 Aug 2008 17:08:36 +0000 Subject: * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- strftime.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'strftime.c') diff --git a/strftime.c b/strftime.c index f2cfea69e6..86284191c2 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) { -- cgit v1.2.3