summaryrefslogtreecommitdiffstats
path: root/src/H5Omtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Omtime.c')
-rw-r--r--src/H5Omtime.c38
1 files changed, 7 insertions, 31 deletions
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index 612d656..c9375f9 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -200,8 +200,8 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
/* decode */
for(i = 0; i < 14; i++)
- if(!HDisdigit(p[i]))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message")
+ if(!HDisdigit(p[i]))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message")
/*
* Convert YYYYMMDDhhmmss UTC to a time_t. This is a little problematic
@@ -219,36 +219,14 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
tm.tm_sec = (p[12]-'0')*10 + (p[13]-'0');
tm.tm_isdst = -1; /*figure it out*/
if((time_t)-1 == (the_time = HDmktime(&tm)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message")
#if defined(H5_HAVE_TM_GMTOFF)
- /* FreeBSD, OSF 4.0 */
+ /* BSD-like systems */
the_time += tm.tm_gmtoff;
-#elif defined(H5_HAVE___TM_GMTOFF)
- /* Linux libc-4 */
- the_time += tm.__tm_gmtoff;
#elif defined(H5_HAVE_TIMEZONE)
- /* Linux libc-5 */
- the_time -= timezone - (tm.tm_isdst?3600:0);
-#elif defined(H5_HAVE_BSDGETTIMEOFDAY) && defined(H5_HAVE_STRUCT_TIMEZONE)
- /* Irix5.3 */
- {
- struct timezone tz;
-
- if(HDBSDgettimeofday(NULL, &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);
- }
-#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(&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);
- }
+ /* GNU/Linux systems */
+ the_time -= timezone - (tm.tm_isdst ? 3600 : 0);
#else
/*
* The catch-all. If we can't convert a character string universal
@@ -257,14 +235,12 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
* only way a user can get the modification time is from our internal
* query routines, which can gracefully recover.
*/
-
- /* Irix64 */
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information")
#endif
/* The return value */
if(NULL == (mesg = H5FL_MALLOC(time_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
*mesg = the_time;
/* Set return value */