diff options
| author | Christos Zoulas <christos@zoulas.com> | 2008-10-20 17:20:41 +0000 |
|---|---|---|
| committer | Christos Zoulas <christos@zoulas.com> | 2008-10-20 17:20:41 +0000 |
| commit | 14beee1a4d0d2da24bce3c98052f3284295316e1 (patch) | |
| tree | 3c007a00f2b17ebf6773ba19ab7763878252a0e2 /src/cdf_time.c | |
| parent | 11c9590f84974c63fa91da14fdefe5a8b6eb9fe8 (diff) | |
| download | file-git-14beee1a4d0d2da24bce3c98052f3284295316e1.tar.gz | |
more autoconf glue.
Diffstat (limited to 'src/cdf_time.c')
| -rw-r--r-- | src/cdf_time.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cdf_time.c b/src/cdf_time.c index dbabae61..b74cd305 100644 --- a/src/cdf_time.c +++ b/src/cdf_time.c @@ -105,7 +105,9 @@ int cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t) { struct tm tm; +#ifdef HAVE_STRUCT_TM_TM_ZONE static char UTC[] = "UTC"; +#endif /* Unit is 100's of nanoseconds */ ts->tv_nsec = (t % CDF_TIME_PREC) * 100; @@ -130,8 +132,12 @@ cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t) tm.tm_wday = 0; tm.tm_yday = 0; tm.tm_isdst = 0; +#ifdef HAVE_STRUCT_TM_TM_GMTOFF tm.tm_gmtoff = 0; +#endif +#ifdef HAVE_STRUCT_TM_TM_ZONE tm.tm_zone = UTC; +#endif tm.tm_year -= 1900; ts->tv_sec = mktime(&tm); if (ts->tv_sec == -1) { |
