diff options
author | Carlo Bramini <carlo_bramini@users.sourceforge.net> | 2008-02-11 16:38:48 +0000 |
---|---|---|
committer | Carlo Bramini <carlo_bramini@users.sourceforge.net> | 2008-02-11 16:38:48 +0000 |
commit | cbbfd6efbf8b632fc039eb1fce729258b5ac3bdb (patch) | |
tree | f8693ebfcc31e0a7c4b95cef4a479bfb2973549b | |
parent | f0aef0a460f5fb86021e6ef13f391c9c15060302 (diff) | |
download | xine-lib-cbbfd6efbf8b632fc039eb1fce729258b5ac3bdb.tar.gz xine-lib-cbbfd6efbf8b632fc039eb1fce729258b5ac3bdb.tar.bz2 |
Fix to timegm.c
timegm.c uses tzset(), but if host does not provide it, compilation or
linking will fail. I fixed it by checking the status of HAVE_TZSET. If the
function is not detected at configure time, it won't be used, like it has
been done in other parts of xine-lib.
-rw-r--r-- | lib/timegm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/timegm.c b/lib/timegm.c index 588131afb..e86e66370 100644 --- a/lib/timegm.c +++ b/lib/timegm.c @@ -5,15 +5,19 @@ time_t xine_private_timegm(struct tm *tm) { time_t ret; +#if defined(HAVE_TZSET) char *tz; tz = getenv("TZ"); setenv("TZ", "", 1); tzset(); +#endif ret = mktime(tm); +#if defined(HAVE_TZSET) if (tz) setenv("TZ", tz, 1); else unsetenv("TZ"); tzset(); +#endif return ret; } |