瀏覽代碼

[kernel][kservice] add comment

zylx 6 年之前
父節點
當前提交
86ad69032f
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      src/kservice.c

+ 8 - 1
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;