提交 7f2731c6 编写于 作者: S sc943313837@gmail.com

removing gettimeofday in mktime that would cause nested call

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2331 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 fd96a07a
......@@ -83,7 +83,7 @@ struct tm* localtime(const time_t* t)
return localtime_r(t, &tmp);
}
time_t timegm(struct tm * const t)
time_t mktime(struct tm * const t)
{
register time_t day;
register time_t i;
......@@ -157,16 +157,6 @@ time_t timegm(struct tm * const t)
return ((day + t->tm_hour) * i + t->tm_min) * i + t->tm_sec;
}
time_t mktime(register struct tm* const t)
{
time_t x = timegm(t);
struct timezone tz = {0};
gettimeofday(0, &tz);
timezone = tz.tz_minuteswest * 60L;
x += timezone;
return x;
}
static void num2str(char *c, int i)
{
c[0] = i / 10 + '0';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册