summaryrefslogtreecommitdiffstats
path: root/src/H5Omtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Omtime.c')
-rw-r--r--src/H5Omtime.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index 9e9702d..bc6a604 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -233,11 +233,12 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p,
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information");
the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0);
}
-#elif defined(H5_HAVE_GETTIMEOFDAY) && defined(H5_HAVE_STRUCT_TIMEZONE)
+#elif defined(H5_HAVE_GETTIMEOFDAY) && defined(H5_HAVE_STRUCT_TIMEZONE) && defined(H5_GETTIMEOFDAY_GIVES_TZ)
{
struct timezone tz;
+ struct timeval tv; /* Used as a placebo; some systems don't like NULL */
- if (HDgettimeofday(NULL, &tz) < 0)
+ if (HDgettimeofday(&tv, &tz) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information");
the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0);
@@ -251,7 +252,8 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p,
tz = timebuffer.timezone;
/* daylight is not handled properly. Currently we just hard-code
the problem. */
- the_time -= tz*60;
+/* the_time -= tz*60; */
+ the_time -= tz * 60 - 3600;
/* the_time -= tz * 60 - 3600 * _daylight;*/
}
#else