fix android timegm

This commit is contained in:
sh8281.kim 2013-11-08 15:44:36 +09:00
parent d26776a775
commit 09257df055

View file

@ -43,12 +43,15 @@ timegm(struct tm *tm)
char *tz;
tz = getenv("TZ");
if (tz)
tz = strdup(tz);
setenv("TZ", "", 1);
tzset();
ret = mktime(tm);
if (tz)
if (tz) {
setenv("TZ", tz, 1);
else
free(tz);
} else
unsetenv("TZ");
tzset();
return ret;