add CONFIG_LIBC_LOCALTIME support
authorVidisha Thapa <thapa.v@samsung.com>
Thu, 10 Aug 2017 07:57:17 +0000 (13:27 +0530)
committerVidisha Thapa <thapa.v@samsung.com>
Thu, 10 Aug 2017 09:09:55 +0000 (14:39 +0530)
With CONFIG_LIBC_LOCALTIME enabled tm struct components were not getting calculated as flag was missing

Signed-off-by: Vidisha Thapa <thapa.v@samsung.com>
lib/libc/time/lib_gmtimer.c

index 966bc21..27b6e1b 100644 (file)
@@ -362,8 +362,7 @@ FAR struct tm *gmtime_r(FAR const time_t *timer, FAR struct tm *result)
        result->tm_hour = (int)hour;
        result->tm_min = (int)min;
        result->tm_sec = (int)sec;
-
-#if defined(CONFIG_TIME_EXTENDED)
+#if defined(CONFIG_LIBC_LOCALTIME) || defined(CONFIG_TIME_EXTENDED)
        result->tm_wday = clock_dayoftheweek(day, month, year);
        result->tm_yday = day + clock_daysbeforemonth(result->tm_mon, clock_isleapyear(year));
        result->tm_isdst = 0;