Browse Source

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
sc943313837@gmail.com 12 years ago
parent
commit
7f2731c666
1 changed files with 1 additions and 11 deletions
  1. 1 11
      components/libc/minilibc/time.c

+ 1 - 11
components/libc/minilibc/time.c

@@ -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';