diff options
| author | [email protected] <[email protected]> | 2012-10-09 15:31:28 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-10-09 15:31:28 +0000 |
| commit | 7f2731c66635105c0412b6ad5c2c57aff8c1cb3e (patch) | |
| tree | 87a4dad28211fe458b48049ec4b9bea193f772ff | |
| parent | fd96a07a24a3c789748bb01246e71628e1ffe958 (diff) | |
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
| -rw-r--r-- | components/libc/minilibc/time.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/components/libc/minilibc/time.c b/components/libc/minilibc/time.c index d8093cf211..84dbd3b84f 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';
|
