Skip to content

Commit

Permalink
fix android timegm
Browse files Browse the repository at this point in the history
  • Loading branch information
ksh8281 committed Nov 8, 2013
1 parent d26776a commit 09257df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rt/rust_builtin.cpp
Expand Up @@ -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;
Expand Down

5 comments on commit 09257df

@bors
Copy link
Contributor

@bors bors commented on 09257df Nov 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from yichoi
at ksh8281@09257df

@bors
Copy link
Contributor

@bors bors commented on 09257df Nov 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging ksh8281/rust/fix_android_timegm = 09257df into auto

@bors
Copy link
Contributor

@bors bors commented on 09257df Nov 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ksh8281/rust/fix_android_timegm = 09257df merged ok, testing candidate = 4ce7d57

@bors
Copy link
Contributor

@bors bors commented on 09257df Nov 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 09257df Nov 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 4ce7d57

Please sign in to comment.