Compare commits
6 Commits
weekly_202
...
weekly_202
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddf3dc8237 | ||
|
|
399e7647bb | ||
|
|
f7af2cdf9b | ||
|
|
07091c5a75 | ||
|
|
6633aabf89 | ||
|
|
2a4282f912 |
@@ -170,7 +170,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCpupInit()
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
/* The calculation time unit is changed to us to decouple the influence of
|
||||
/* The calculation time unit is changed to us to decouple the influence of
|
||||
* system frequency modulation on CPUP
|
||||
*/
|
||||
STATIC UINT64 CpupTimeUsGet(VOID)
|
||||
|
||||
@@ -564,7 +564,6 @@ int LfsClose(struct File *file)
|
||||
}
|
||||
|
||||
ret = lfs_file_close((lfs_t *)mp->mData, lfsHandle);
|
||||
|
||||
if (ret != 0) {
|
||||
errno = LittlefsErrno(ret);
|
||||
ret = (int)LOS_NOK;
|
||||
|
||||
@@ -212,7 +212,7 @@ static size_t GetCanonicalPath(const char *cwd, const char *path, char *buf, siz
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int VfsPathCheck(const char *path, bool isFile)
|
||||
static int VfsPathCheck(const char *path, bool isFile)
|
||||
{
|
||||
size_t len;
|
||||
if ((path == NULL) || (path[0] == '\0')) {
|
||||
@@ -561,7 +561,7 @@ int open(const char *path, int flags, ...)
|
||||
#endif
|
||||
|
||||
int ret = VfsOpen(path, flags);
|
||||
return MapToPosixRet(ret);
|
||||
return MapToPosixRet(ret);
|
||||
}
|
||||
FUNC_ALIAS(open, _open, (const char *path, int flags, ...), int);
|
||||
|
||||
@@ -630,7 +630,7 @@ ssize_t read(int fd, void *buff, size_t bytes)
|
||||
ret = VfsRead(fd, buff, bytes);
|
||||
}
|
||||
|
||||
return MapToPosixRet(ret);
|
||||
return MapToPosixRet(ret);
|
||||
}
|
||||
FUNC_ALIAS(read, _read, (int fd, void *buff, size_t bytes), ssize_t);
|
||||
|
||||
@@ -1093,7 +1093,7 @@ int fcntl(int fd, int cmd, ...)
|
||||
va_start(ap, cmd);
|
||||
if (fd < CONFIG_NFILE_DESCRIPTORS) {
|
||||
filep = VfsAttachFileReady(fd);
|
||||
ret = VfsVfcntl(filep, cmd, ap);
|
||||
ret = VfsVfcntl(filep, cmd, ap);
|
||||
VfsDetachFile(filep);
|
||||
} else {
|
||||
#ifndef LOSCFG_NET_LWIP_SACK
|
||||
|
||||
@@ -664,7 +664,7 @@ static time_t ConvertUtc2Secs(struct tm *tm)
|
||||
seconds += (tm->tm_mday - 1) * SECS_PER_DAY;
|
||||
seconds += tm->tm_hour * SECS_PER_HOUR + tm->tm_min * SECS_PER_MIN + tm->tm_sec;
|
||||
|
||||
seconds -= tm->__tm_gmtoff; // sub time zone to get UTC time
|
||||
seconds += g_timezone;
|
||||
return seconds;
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ time_t mktime(struct tm *tmptr)
|
||||
}
|
||||
timeInSeconds = ConvertUtc2Secs(tmptr);
|
||||
/* normalize tm_wday and tm_yday */
|
||||
ConvertSecs2Utc(timeInSeconds, tmptr->__tm_gmtoff, tmptr);
|
||||
ConvertSecs2Utc(timeInSeconds, -g_timezone, tmptr);
|
||||
return timeInSeconds;
|
||||
}
|
||||
|
||||
|
||||
@@ -377,12 +377,12 @@ LITE_TEST_CASE(PosixTimeFuncTestSuite, testTimeMktime001, Function | MediumTest
|
||||
INIT_TM(timeptr, 2020, 7, 9, 18, 10, 0, 7);
|
||||
time_t timeRet = mktime(&timeptr);
|
||||
LOG("\n 2020-7-9 18:10:00, mktime Ret = %lld", timeRet);
|
||||
TEST_ASSERT_EQUAL_INT(1596996600, timeRet);
|
||||
TEST_ASSERT_EQUAL_INT(1596967800, timeRet);
|
||||
|
||||
INIT_TM(timeptr, 1970, 0, 1, 8, 0, 0, 0);
|
||||
timeRet = mktime(&timeptr);
|
||||
LOG("\n 1970-1-1 08:00:00, mktime Ret = %lld", timeRet);
|
||||
TEST_ASSERT_EQUAL_INT(28800, timeRet);
|
||||
TEST_ASSERT_EQUAL_INT(0, timeRet);
|
||||
|
||||
struct tm *stm = localtime(&testTime);
|
||||
LOG("\n testTime 18880, tm : %s", TmToStr(stm, timeStr, TIME_STR_LEN));
|
||||
|
||||
Reference in New Issue
Block a user