summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-03-10 07:41:24 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-03-10 07:41:24 (GMT)
commit4a2a4bd95b8c0ce284f428be5ddcf937b5ce7662 (patch)
tree6015f9f170222985c5d1efacb9396c629c18cb43 /src
parent6b1176f34e780cd597f32991ae3952ea371c66fe (diff)
downloadhdf5-4a2a4bd95b8c0ce284f428be5ddcf937b5ce7662.zip
hdf5-4a2a4bd95b8c0ce284f428be5ddcf937b5ce7662.tar.gz
hdf5-4a2a4bd95b8c0ce284f428be5ddcf937b5ce7662.tar.bz2
[svn-r26413] Merge of r26276 from trunk.
Cleans up time functions in the autotools input files. - Lumps all the time functionality together in configure.ac. This was previously more spread out due to Solaris issues with the ordering of certain checks. - Removes processing that handles __tm_gmtoff members of struct tm. (libc-4) - Removes BSDgettimeofday(). (IRIX 5.3) - Removes timezone struct processing in gettimeofday(). (considered harmful) Fixes: HDFFV-9083 and HDFFV-9085 Tested on: h5committest OS X (quail) Solaris (emu)
Diffstat (limited to 'src')
-rw-r--r--src/H5Omtime.c38
-rw-r--r--src/H5config.h.in30
-rw-r--r--src/H5private.h3
3 files changed, 7 insertions, 64 deletions
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index e719e08..a3703b5 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -194,8 +194,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
@@ -213,36 +213,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
@@ -251,14 +229,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 */
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 0eba3bb..a2fa0ad 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -49,9 +49,6 @@
long long values. */
#undef FP_TO_ULLONG_RIGHT_MAXIMUM
-/* Define if gettimeofday() populates the tz pointer passed in */
-#undef GETTIMEOFDAY_GIVES_TZ
-
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
@@ -61,9 +58,6 @@
/* Define if the __attribute__(()) extension is present */
#undef HAVE_ATTRIBUTE
-/* Define to 1 if you have the `BSDgettimeofday' function. */
-#undef HAVE_BSDGETTIMEOFDAY
-
/* Define if the compiler understands C99 designated initialization of structs
and unions */
#undef HAVE_C99_DESIGNATED_INITIALIZER
@@ -80,10 +74,6 @@
/* Define if Darwin or Mac OS X */
#undef HAVE_DARWIN
-/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
- */
-#undef HAVE_DECL_TZNAME
-
/* Define to 1 if you have the `difftime' function. */
#undef HAVE_DIFFTIME
@@ -298,12 +288,6 @@
/* Define if `struct text_info' is defined */
#undef HAVE_STRUCT_TEXT_INFO
-/* Define if `struct timezone' is defined */
-#undef HAVE_STRUCT_TIMEZONE
-
-/* Define to 1 if `tm_zone' is a member of `struct tm'. */
-#undef HAVE_STRUCT_TM_TM_ZONE
-
/* Define if `struct videoconfig' is defined */
#undef HAVE_STRUCT_VIDEOCONFIG
@@ -364,14 +348,6 @@
/* Define if `tm_gmtoff' is a member of `struct tm' */
#undef HAVE_TM_GMTOFF
-/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
- `HAVE_STRUCT_TM_TM_ZONE' instead. */
-#undef HAVE_TM_ZONE
-
-/* Define to 1 if you don't have `tm_zone' but do have the external array
- `tzname'. */
-#undef HAVE_TZNAME
-
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@@ -399,9 +375,6 @@
/* Define to 1 if you have the `_scrsize' function. */
#undef HAVE__SCRSIZE
-/* Define if `__tm_gmtoff' is a member of `struct tm' */
-#undef HAVE___TM_GMTOFF
-
/* Define if your system can't handle converting floating-point values to long
long. */
#undef HW_FP_TO_LLONG_NOT_WORKS
@@ -609,9 +582,6 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#undef TM_IN_SYS_TIME
-
/* Define if your system can compile unsigned long long to floating-point
casts. */
#undef ULLONG_TO_FP_CAST_WORKS
diff --git a/src/H5private.h b/src/H5private.h
index 2a3c79e..c4e3d02 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -608,9 +608,6 @@ typedef struct {
#ifndef HDatol
#define HDatol(S) atol(S)
#endif /* HDatol */
-#ifndef HDBSDgettimeofday
- #define HDBSDgettimeofday(S,P) BSDgettimeofday(S,P)
-#endif /* HDBSDgettimeofday */
#ifndef HDbsearch
#define HDbsearch(K,B,N,Z,F) bsearch(K,B,N,Z,F)
#endif /* HDbsearch */