fix android timegm
This commit is contained in:
parent
d26776a775
commit
09257df055
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue