From 7f2731c66635105c0412b6ad5c2c57aff8c1cb3e Mon Sep 17 00:00:00 2001 From: "sc943313837@gmail.com" Date: Tue, 9 Oct 2012 15:31:28 +0000 Subject: [PATCH] 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 --- components/libc/minilibc/time.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/components/libc/minilibc/time.c b/components/libc/minilibc/time.c index d8093cf21..84dbd3b84 100644 --- a/components/libc/minilibc/time.c +++ b/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';