From 86ad69032f7cfa0c9666a9b6ee35358c29362470 Mon Sep 17 00:00:00 2001 From: zylx Date: Wed, 24 Oct 2018 11:58:33 +0800 Subject: [PATCH] [kernel][kservice] add comment --- src/kservice.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/kservice.c b/src/kservice.c index 0a60fa0142..d920e52323 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -1177,6 +1177,12 @@ void rt_kprintf(const char *fmt, ...) RTM_EXPORT(rt_kprintf); #endif +/** + * This function will convert Time (Restartable) + * + * @param timep the timestamp + * @param result the structure to stores information + */ struct tm *rt_gmtime_r(const time_t *timep, struct tm *result) { #define IS_LEAP_YEAR(year) (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) @@ -1206,6 +1212,7 @@ struct tm *rt_gmtime_r(const time_t *timep, struct tm *result) break; } result->tm_year = year - 1900; + result->tm_yday = daycount; while (daycount >= 28) { @@ -1225,7 +1232,7 @@ struct tm *rt_gmtime_r(const time_t *timep, struct tm *result) } month++; } - result->tm_mon = month + 1; + result->tm_mon = month; result->tm_mday = daycount + 1; } return result; -- GitLab