diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-02-23 06:56:16 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-02-23 06:56:16 (GMT) |
commit | 7e220930da7e77df1531329d8897befa0dc6399f (patch) | |
tree | 12f84783be1e29da4ede9caf29a1c29b1c8f7e50 /src/H5Omtime.c | |
parent | 7c134068147c8313fb4303b4d6608a665880e22e (diff) | |
download | hdf5-7e220930da7e77df1531329d8897befa0dc6399f.zip hdf5-7e220930da7e77df1531329d8897befa0dc6399f.tar.gz hdf5-7e220930da7e77df1531329d8897befa0dc6399f.tar.bz2 |
[svn-r26276] Merged r26075-80, 86 from features/autotools_rework branch.
Cleans up time functions in the autotools input files. Removed deprecated
gettimeofday() time zone code and configure processing. Also removed
some unused time function configure checks and defines.
Fixes: HDFFV-9083 and HDFFV-9085
Tested on: 32-bit linux, serial and parallel (jam)
OS X (kite)
Solaris (emu)
Diffstat (limited to 'src/H5Omtime.c')
-rw-r--r-- | src/H5Omtime.c | 38 |
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 */ |