Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
f34762c1
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
460
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f34762c1
编写于
9月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1001 修复函数返回错误等问题
Merge pull request !1001 from zhangdengyu/fix_tsacn
上级
453c3761
043e84df
变更
34
隐藏空白更改
内联
并排
Showing
34 changed file
with
82 addition
and
79 deletion
+82
-79
apps/lms/src/sample_usr_lms.c
apps/lms/src/sample_usr_lms.c
+2
-1
apps/perf/src/main.c
apps/perf/src/main.c
+1
-1
apps/tftp/src/tftpc.c
apps/tftp/src/tftpc.c
+0
-2
apps/trace/src/trace.c
apps/trace/src/trace.c
+1
-1
fs/fat/os_adapt/fatfs.c
fs/fat/os_adapt/fatfs.c
+2
-2
fs/vfs/bcache/src/bcache.c
fs/vfs/bcache/src/bcache.c
+0
-3
fs/vfs/include/vnode.h
fs/vfs/include/vnode.h
+1
-1
fs/vfs/vfs_cmd/vfs_shellcmd.c
fs/vfs/vfs_cmd/vfs_shellcmd.c
+0
-5
fs/vfs/vnode.c
fs/vfs/vnode.c
+1
-1
kernel/base/mp/los_lockdep.c
kernel/base/mp/los_lockdep.c
+1
-1
kernel/base/vm/los_vm_dump.c
kernel/base/vm/los_vm_dump.c
+10
-12
kernel/base/vm/los_vm_scan.c
kernel/base/vm/los_vm_scan.c
+1
-1
kernel/base/vm/los_vm_syscall.c
kernel/base/vm/los_vm_syscall.c
+1
-1
kernel/common/console.c
kernel/common/console.c
+8
-2
kernel/common/los_init.c
kernel/common/los_init.c
+0
-1
kernel/extended/dynload/src/los_load_elf.c
kernel/extended/dynload/src/los_load_elf.c
+1
-1
kernel/extended/lms/usr/los_lms.c
kernel/extended/lms/usr/los_lms.c
+4
-4
net/lwip-2.1/enhancement/src/api_shell.c
net/lwip-2.1/enhancement/src/api_shell.c
+7
-5
security/vid/vid.c
security/vid/vid.c
+1
-1
security/vid/vid_api.h
security/vid/vid_api.h
+3
-3
shell/full/src/base/shell_lk.c
shell/full/src/base/shell_lk.c
+1
-1
shell/full/src/base/shmsg.c
shell/full/src/base/shmsg.c
+1
-1
shell/full/src/cmds/dmesg.c
shell/full/src/cmds/dmesg.c
+1
-1
syscall/syscall_pub.c
syscall/syscall_pub.c
+4
-0
testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_001.c
...rnel/sample/kernel_extend/cpup/smoke/It_extend_cpup_001.c
+2
-1
testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_002.c
...rnel/sample/kernel_extend/cpup/smoke/It_extend_cpup_002.c
+2
-1
testsuites/unittest/basic/exc/smoke/it_test_exc_001.cpp
testsuites/unittest/basic/exc/smoke/it_test_exc_001.cpp
+0
-3
testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp
testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp
+0
-5
testsuites/unittest/extended/signal/smoke/mkfifo_test_001.cpp
...suites/unittest/extended/signal/smoke/mkfifo_test_001.cpp
+1
-1
testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp
...suites/unittest/extended/signal/smoke/mkfifo_test_002.cpp
+0
-3
testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp
testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp
+15
-5
testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp
testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp
+8
-6
testsuites/unittest/process/basic/process/smoke/process_test_002.cpp
...unittest/process/basic/process/smoke/process_test_002.cpp
+1
-1
testsuites/unittest/process/basic/process/smoke/process_test_013.cpp
...unittest/process/basic/process/smoke/process_test_013.cpp
+1
-1
未找到文件。
apps/lms/src/sample_usr_lms.c
浏览文件 @
f34762c1
...
...
@@ -180,7 +180,8 @@ static void LmsStrcpyTest(void)
return
;
}
char
*
testStr
=
"bbbbbbbbbbbbbbbbb"
;
printf
(
"[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d
\n
"
,
strlen
(
testStr
)
+
1
);
printf
(
"[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d
\n
"
,
(
int
)
strlen
(
testStr
)
+
1
);
strcpy
(
buf
,
testStr
);
free
(
buf
);
printf
(
"
\n
-------- LmsStrcpyTest End --------
\n
"
);
...
...
apps/perf/src/main.c
浏览文件 @
f34762c1
...
...
@@ -62,7 +62,7 @@ int main(int argc, char **argv)
PerfStop
(
fd
);
}
else
if
((
argc
==
THREE_ARGS
)
&&
strcmp
(
argv
[
1
],
"read"
)
==
0
)
{
size_t
size
=
strtoul
(
argv
[
THREE_ARGS
-
1
],
NULL
,
0
);
if
(
size
<
=
0
)
{
if
(
size
=
=
0
)
{
goto
EXIT
:
}
...
...
apps/tftp/src/tftpc.c
浏览文件 @
f34762c1
...
...
@@ -1437,10 +1437,8 @@ u32_t lwip_tftp_get_file_by_filename_to_rawmem(u32_t ulHostAddr,
{
s32_t
iSockNum
=
TFTP_NULL_INT32
;
u32_t
ulSrcStrLen
;
u32_t
lDestStrLen
;
u32_t
ulSize
;
u32_t
ulRecvSize
=
TFTP_NULL_UINT32
;
s32_t
iErrCode
;
u32_t
ulErrCode
;
u16_t
usReadReq
;
u16_t
usTempServPort
;
...
...
apps/trace/src/trace.c
浏览文件 @
f34762c1
...
...
@@ -70,7 +70,7 @@ static void TraceRead(int fd, size_t size)
{
ssize_t
i
;
ssize_t
len
;
if
(
size
<
=
0
)
{
if
(
size
=
=
0
)
{
return
;
}
...
...
fs/fat/os_adapt/fatfs.c
浏览文件 @
f34762c1
...
...
@@ -1409,7 +1409,7 @@ DWORD fattime_format(time_t time)
ftime
|=
((
DWORD
)((
st
.
tm_year
>
YEAR_OFFSET
)
?
(
st
.
tm_year
-
YEAR_OFFSET
)
:
0
))
<<
FTIME_YEAR_OFFSET
;
ftime
<<=
FTIME_DATE_OFFSET
;
ftime
=
(
DWORD
)
st
.
tm_sec
/
SEC_MULTIPLIER
;
ftime
|
=
(
DWORD
)
st
.
tm_sec
/
SEC_MULTIPLIER
;
ftime
|=
((
DWORD
)
st
.
tm_min
)
<<
FTIME_MIN_OFFSET
;
ftime
|=
((
DWORD
)
st
.
tm_hour
)
<<
FTIME_HR_OFFSET
;
...
...
@@ -2167,7 +2167,7 @@ int fatfs_symlink(struct Vnode *parentVnode, struct Vnode **newVnode, const char
ssize_t
fatfs_readlink
(
struct
Vnode
*
vnode
,
char
*
buffer
,
size_t
bufLen
)
{
int
ret
;
FRESULT
res
=
FR_OK
;
FRESULT
res
;
DWORD
clust
;
QWORD
sect
;
DIR_FILE
*
dfp
=
(
DIR_FILE
*
)(
vnode
->
data
);
...
...
fs/vfs/bcache/src/bcache.c
浏览文件 @
f34762c1
...
...
@@ -583,9 +583,6 @@ static OsBcacheBlock *AllocNewBlock(OsBcache *bc, BOOL read, UINT64 num)
if
(
prefer
->
used
)
{
MergeSyncBlocks
(
bc
,
prefer
);
}
if
(
prefer
->
used
)
{
BcacheSyncBlock
(
bc
,
prefer
);
DelBlock
(
bc
,
prefer
);
}
...
...
fs/vfs/include/vnode.h
浏览文件 @
f34762c1
...
...
@@ -160,7 +160,7 @@ typedef int VfsHashCmp(struct Vnode *vnode, void *arg);
int
VnodesInit
(
void
);
int
VnodeDevInit
(
void
);
int
VnodeAlloc
(
struct
VnodeOps
*
vop
,
struct
Vnode
**
v
node
);
int
VnodeAlloc
(
struct
VnodeOps
*
vop
,
struct
Vnode
**
newV
node
);
int
VnodeFree
(
struct
Vnode
*
vnode
);
int
VnodeLookup
(
const
char
*
path
,
struct
Vnode
**
vnode
,
uint32_t
flags
);
int
VnodeLookupFullpath
(
const
char
*
fullpath
,
struct
Vnode
**
vnode
,
uint32_t
flags
);
...
...
fs/vfs/vfs_cmd/vfs_shellcmd.c
浏览文件 @
f34762c1
...
...
@@ -761,11 +761,6 @@ static int os_shell_cmd_do_rmdir(const char *pathname)
}
if
(
strcmp
(
dirent
->
d_name
,
".."
)
&&
strcmp
(
dirent
->
d_name
,
"."
))
{
size_t
fullpath_buf_size
=
strlen
(
pathname
)
+
strlen
(
dirent
->
d_name
)
+
SEPARATOR_EOF_LEN
;
if
(
fullpath_buf_size
<=
0
)
{
PRINTK
(
"buffer size is invalid!
\n
"
);
(
void
)
closedir
(
d
);
return
-
1
;
}
fullpath
=
(
char
*
)
malloc
(
fullpath_buf_size
);
if
(
fullpath
==
NULL
)
{
PRINTK
(
"malloc failure!
\n
"
);
...
...
fs/vfs/vnode.c
浏览文件 @
f34762c1
...
...
@@ -260,7 +260,7 @@ int VnodeDrop(void)
static
char
*
NextName
(
char
*
pos
,
uint8_t
*
len
)
{
char
*
name
=
NULL
;
while
(
*
pos
!=
0
&&
*
pos
==
'/'
)
{
while
(
*
pos
==
'/'
)
{
pos
++
;
}
if
(
*
pos
==
'\0'
)
{
...
...
kernel/base/mp/los_lockdep.c
浏览文件 @
f34762c1
...
...
@@ -271,7 +271,7 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
{
UINT32
intSave
;
INT32
depth
;
enum
LockDepErrType
checkResult
=
LOCKDEP_SUCCESS
;
enum
LockDepErrType
checkResult
;
VOID
*
requestAddr
=
(
VOID
*
)
__builtin_return_address
(
1
);
LosTaskCB
*
current
=
OsCurrTaskGet
();
LosTaskCB
*
owner
=
NULL
;
...
...
kernel/base/vm/los_vm_dump.c
浏览文件 @
f34762c1
...
...
@@ -208,15 +208,12 @@ UINT32 OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm)
PADDR_T
paddr
;
STATUS_T
ret
;
INT32
shareRef
;
UINT32
pmSize
=
0
;
if
(
sharePm
!=
NULL
)
{
*
sharePm
=
0
;
}
if
(
actualPm
!=
NULL
)
{
*
actualPm
=
0
;
}
ret
=
LOS_MuxAcquire
(
&
space
->
regionMux
);
if
(
ret
!=
0
)
{
return
0
;
...
...
@@ -240,19 +237,20 @@ UINT32 OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm)
if
(
sharePm
!=
NULL
)
{
*
sharePm
+=
PAGE_SIZE
;
}
if
(
actualPm
!=
NULL
)
{
*
actualPm
+=
PAGE_SIZE
/
shareRef
;
}
pmSize
+=
PAGE_SIZE
/
shareRef
;
}
else
{
if
(
actualPm
!=
NULL
)
{
*
actualPm
+=
PAGE_SIZE
;
}
pmSize
+=
PAGE_SIZE
;
}
}
RB_SCAN_SAFE_END
(
&
oldVmSpace
->
regionRbTree
,
pstRbNode
,
pstRbNodeNext
)
(
VOID
)
LOS_MuxRelease
(
&
space
->
regionMux
);
return
*
actualPm
;
if
(
actualPm
!=
NULL
)
{
*
actualPm
=
pmSize
;
}
return
pmSize
;
}
LosProcessCB
*
OsGetPIDByAspace
(
LosVmSpace
*
space
)
...
...
@@ -305,7 +303,7 @@ UINT32 OsCountRegionPages(LosVmSpace *space, LosVmMapRegion *region, UINT32 *pss
}
if
(
pssPages
!=
NULL
)
{
*
pssPages
=
(
UINT32
)(
pss
+
0
.
5
);
*
pssPages
=
(
UINT32
)(
pss
+
0
.
5
);
/* 0.5, for page alignment */
}
return
regionPages
;
...
...
kernel/base/vm/los_vm_scan.c
浏览文件 @
f34762c1
...
...
@@ -297,7 +297,7 @@ int OsTryShrinkMemory(size_t nPage)
LosFilePage
*
fpage
=
NULL
;
LosFilePage
*
fnext
=
NULL
;
if
(
nPage
<
=
0
)
{
if
(
nPage
=
=
0
)
{
nPage
=
VM_FILEMAP_MIN_SCAN
;
}
...
...
kernel/base/vm/los_vm_syscall.c
浏览文件 @
f34762c1
...
...
@@ -166,7 +166,7 @@ MMAP_DONE:
STATUS_T
LOS_UnMMap
(
VADDR_T
addr
,
size_t
size
)
{
if
((
addr
<=
0
)
||
(
size
<
=
0
))
{
if
((
addr
<=
0
)
||
(
size
=
=
0
))
{
return
-
EINVAL
;
}
...
...
kernel/common/console.c
浏览文件 @
f34762c1
...
...
@@ -709,7 +709,6 @@ STATIC ssize_t DoWrite(CirBufSendCB *cirBufSendCB, CHAR *buffer, size_t bufLen)
{
INT32
cnt
;
size_t
written
=
0
;
size_t
toWrite
=
bufLen
;
UINT32
intSave
;
#ifdef LOSCFG_SHELL_DMESG
...
...
@@ -730,7 +729,6 @@ STATIC ssize_t DoWrite(CirBufSendCB *cirBufSendCB, CHAR *buffer, size_t bufLen)
if
(
cnt
<=
0
)
{
break
;
}
toWrite
-=
cnt
;
written
+=
cnt
;
}
LOS_SpinUnlockRestore
(
&
g_consoleWriteSpinLock
,
intSave
);
...
...
@@ -1536,7 +1534,15 @@ STATIC ssize_t WriteToTerminal(const CONSOLE_CB *consoleCB, const CHAR *buffer,
fd
=
consoleCB
->
fd
;
ret
=
fs_getfilep
(
fd
,
&
filep
);
if
(
ret
<
0
)
{
ret
=
-
EPERM
;
goto
ERROUT
;
}
ret
=
GetFilepOps
(
filep
,
&
privFilep
,
&
fileOps
);
if
(
ret
!=
ENOERR
)
{
ret
=
-
EINVAL
;
goto
ERROUT
;
}
if
((
fileOps
==
NULL
)
||
(
fileOps
->
write
==
NULL
))
{
ret
=
EFAULT
;
...
...
kernel/common/los_init.c
浏览文件 @
f34762c1
...
...
@@ -87,7 +87,6 @@ STATIC VOID InitLevelCall(const CHAR *name, const UINT32 level, struct ModuleIni
LOS_SpinUnlock
(
&
g_initLock
);
if
(
module
->
hook
!=
NULL
)
{
#ifdef LOS_INIT_DEBUG
ret
=
LOS_OK
;
startNsec
=
LOS_CurrNanosec
();
ret
=
(
UINT32
)
module
->
hook
();
endNsec
=
LOS_CurrNanosec
();
...
...
kernel/extended/dynload/src/los_load_elf.c
浏览文件 @
f34762c1
...
...
@@ -51,7 +51,7 @@ STATIC BOOL g_srandInit;
STATIC
INT32
OsELFOpen
(
const
CHAR
*
fileName
,
INT32
oflags
)
{
INT32
ret
=
-
LOS_NOK
;
INT32
ret
;
INT32
procFd
;
procFd
=
AllocProcessFd
();
...
...
kernel/extended/lms/usr/los_lms.c
浏览文件 @
f34762c1
...
...
@@ -124,8 +124,8 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsSetShadowValue(uintptr_t startAddr, uintpt
uint32_t
startOffset
;
uint32_t
endOffset
;
char
shadowValueMask
;
char
shadowValue
;
unsigned
char
shadowValueMask
;
unsigned
char
shadowValue
;
/* endAddr - 1, then we mark [startAddr, endAddr) to value */
LmsMem2Shadow
(
startAddr
,
&
shadowStart
,
&
startOffset
);
...
...
@@ -266,7 +266,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsPrintMemInfo(uintptr_t addr)
}
}
LMS_OUTPUT_INFO
(
"|
\t
[0x%x | %2
d
]: "
,
shadowAddr
,
shadowOffset
);
LMS_OUTPUT_INFO
(
"|
\t
[0x%x | %2
u
]: "
,
shadowAddr
,
shadowOffset
);
for
(
int
x
=
0
;
x
<
printX
;
x
+=
LMS_MEM_BYTES_PER_SHADOW_CELL
)
{
LmsGetShadowValue
(
dumpAddr
+
x
,
&
shadowValue
);
...
...
@@ -339,7 +339,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsPrintErrInfo(LmsAddrInfo *info, uin
break
;
}
LMS_OUTPUT_INFO
(
"Shadow memory address: [0x%x : %
d] Shadow memory value: [%d
]
\n
"
,
info
->
shadowAddr
,
LMS_OUTPUT_INFO
(
"Shadow memory address: [0x%x : %
u] Shadow memory value: [%u
]
\n
"
,
info
->
shadowAddr
,
info
->
shadowOffset
,
info
->
shadowValue
);
LMS_OUTPUT_INFO
(
"
\n
"
);
...
...
net/lwip-2.1/enhancement/src/api_shell.c
浏览文件 @
f34762c1
...
...
@@ -342,7 +342,7 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len)
buf_len
-=
(
unsigned
int
)
ret
;
ret
=
snprintf_s
(
tmp
,
buf_len
,
(
buf_len
-
1
),
" MTU:%d %s"
,
netif
->
mtu
,
netif
->
flags
&
NETIF_FLAG_UP
?
"Running"
:
"Stop"
);
(
netif
->
flags
&
NETIF_FLAG_UP
)
?
"Running"
:
"Stop"
);
if
((
ret
<=
0
)
||
((
unsigned
int
)
ret
>=
buf_len
))
goto
out
;
tmp
+=
ret
;
...
...
@@ -356,7 +356,8 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len)
buf_len
-=
(
unsigned
int
)
ret
;
}
ret
=
snprintf_s
(
tmp
,
buf_len
,
(
buf_len
-
1
),
" %s
\n
"
,
netif
->
flags
&
NETIF_FLAG_LINK_UP
?
"Link UP"
:
"Link Down"
);
ret
=
snprintf_s
(
tmp
,
buf_len
,
(
buf_len
-
1
),
" %s
\n
"
,
(
netif
->
flags
&
NETIF_FLAG_LINK_UP
)
?
"Link UP"
:
"Link Down"
);
if
((
ret
<=
0
)
||
((
unsigned
int
)
ret
>=
buf_len
))
goto
out
;
tmp
+=
ret
;
...
...
@@ -3019,8 +3020,8 @@ int netstat_netconn_sendq(struct netconn *conn)
#if PF_PKT_SUPPORT
case
NETCONN_PKT_RAW
:
retVal
=
0
;
/* always be 0 as frame send to driver directly */
#endif
break
;
#endif
case
NETCONN_UDP
:
retVal
=
netstat_udp_sendq
(
conn
->
pcb
.
udp
);
break
;
...
...
@@ -3797,8 +3798,9 @@ u32_t osShellIpDebug(int argc, const char **argv)
PRINTK
(
"%-50s "
,
acIPv6Addr
);
if
(
snprintf_s
(
aclladdr
,
sizeof
(
aclladdr
),
sizeof
(
aclladdr
)
-
1
,
"%02X:%02X:%02X:%02X:%02X:%02X"
,
neighbor_cache
[
i
].
lladdr
[
0
],
neighbor_cache
[
i
].
lladdr
[
1
],
neighbor_cache
[
i
].
lladdr
[
2
],
neighbor_cache
[
i
].
lladdr
[
3
],
neighbor_cache
[
i
].
lladdr
[
4
],
neighbor_cache
[
i
].
lladdr
[
5
])
<
0
)
{
neighbor_cache
[
i
].
lladdr
[
0
],
neighbor_cache
[
i
].
lladdr
[
1
],
/* 0, 1, member number */
neighbor_cache
[
i
].
lladdr
[
2
],
neighbor_cache
[
i
].
lladdr
[
3
],
/* 2, 3, member number */
neighbor_cache
[
i
].
lladdr
[
4
],
neighbor_cache
[
i
].
lladdr
[
5
])
<
0
)
{
/* 4, 5, member number */
return
LOS_NOK
;
}
PRINTK
(
"%-25s "
,
aclladdr
);
...
...
security/vid/vid.c
浏览文件 @
f34762c1
...
...
@@ -160,7 +160,7 @@ static VOID ReleaseVid(UINT16 vid)
a
=
vid
>>
INT_BIT_SHIFT
;
b
=
vid
&
(
INT_BIT_COUNT
-
1
);
idMap
->
bitMap
[
a
]
&=
~
(
1
<<
b
);
idMap
->
bitMap
[
a
]
&=
~
(
1
U
<<
b
);
/* shrink bit map */
if
(
mapMaxNum
>
1
)
{
...
...
security/vid/vid_api.h
浏览文件 @
f34762c1
...
...
@@ -34,9 +34,9 @@
#include "los_typedef.h"
#include "los_process_pri.h"
#define INT_BIT_COUNT 32
#define INT_BIT_SHIFT 5
#define VID_MAP_MAX_NUM 32
#define INT_BIT_COUNT 32
U
#define INT_BIT_SHIFT 5
U
#define VID_MAP_MAX_NUM 32
U
#define MAX_INVALID_TIMER_VID (VID_MAP_MAX_NUM * INT_BIT_COUNT)
...
...
shell/full/src/base/shell_lk.c
浏览文件 @
f34762c1
...
...
@@ -145,7 +145,7 @@ INT32 CmdLog(INT32 argc, const CHAR **argv)
}
}
else
if
(
!
strncmp
(
argv
[
0
],
"module"
,
strlen
(
argv
[
0
])
+
1
))
{
module
=
strtoul
(
argv
[
1
],
&
p
,
0
);
if
((
*
p
!=
0
)
||
(
module
>
MODULE4
)
||
(
module
<
MODULE0
))
{
if
((
*
p
!=
0
)
||
(
module
>
MODULE4
)
||
(
module
==
MODULE0
))
{
PRINTK
(
"log %s can't access %s
\n
"
,
argv
[
0
],
argv
[
1
]);
PRINTK
(
"not support yet
\n
"
);
return
-
1
;
...
...
shell/full/src/base/shmsg.c
浏览文件 @
f34762c1
...
...
@@ -329,7 +329,7 @@ END:
LITE_OS_SEC_TEXT_MINOR
UINT32
ShellEntry
(
UINTPTR
param
)
{
CHAR
ch
;
INT32
n
=
0
;
INT32
n
;
ShellCB
*
shellCB
=
(
ShellCB
*
)
param
;
CONSOLE_CB
*
consoleCB
=
OsGetConsoleByID
((
INT32
)
shellCB
->
consoleID
);
...
...
shell/full/src/cmds/dmesg.c
浏览文件 @
f34762c1
...
...
@@ -425,7 +425,7 @@ STATIC VOID OsBufFullWrite(const CHAR *dst, UINT32 logLen)
STATIC
VOID
OsWriteTailToHead
(
const
CHAR
*
dst
,
UINT32
logLen
)
{
UINT32
writeLen
=
0
;
UINT32
writeLen
;
UINT32
bufSize
=
g_logBufSize
;
UINT32
logSize
=
g_dmesgInfo
->
logSize
;
UINT32
tail
=
g_dmesgInfo
->
logTail
;
...
...
syscall/syscall_pub.c
浏览文件 @
f34762c1
...
...
@@ -83,6 +83,10 @@ int GetFullpath(int fd, const char *path, char **fullpath)
fd
=
GetAssociatedSystemFd
(
fd
);
}
ret
=
fs_getfilep
(
fd
,
&
file
);
if
(
ret
<
0
)
{
ret
=
-
EPERM
;
goto
OUT
;
}
if
(
file
)
{
ret
=
stat
(
file
->
f_path
,
&
bufRet
);
if
(
!
ret
)
{
...
...
testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_001.c
浏览文件 @
f34762c1
...
...
@@ -39,8 +39,9 @@ extern "C" {
static
UINT32
TaskF02
(
VOID
)
{
UINT32
ret
,
cpupUse
;
UINT32
ret
=
OS_ERROR
,
cpupUse
;
g_cpupTestCount
++
;
// 2, Here, assert that g_cpupTestCount is equal to the expected value.
ICUNIT_GOTO_EQUAL
(
g_cpupTestCount
,
2
,
g_cpupTestCount
,
EXIT
);
cpupUse
=
LOS_HistoryProcessCpuUsage
(
g_testTaskID01
,
CPUP_ALL_TIME
);
...
...
testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_002.c
浏览文件 @
f34762c1
...
...
@@ -39,9 +39,10 @@ extern "C" {
static
UINT32
TaskF01
(
VOID
)
{
UINT32
ret
;
UINT32
ret
=
OS_ERROR
;
UINT32
cpupUse
;
g_cpupTestCount
++
;
ICUNIT_GOTO_EQUAL
(
g_cpupTestCount
,
1
,
g_cpupTestCount
,
EXIT
);
cpupUse
=
LOS_HistoryProcessCpuUsage
(
LOS_GetCurrProcessID
(),
CPU_USE_MODE0
);
...
...
testsuites/unittest/basic/exc/smoke/it_test_exc_001.cpp
浏览文件 @
f34762c1
...
...
@@ -33,12 +33,10 @@
static
int
TestCase
(
void
)
{
int
ret
;
int
*
test
=
NULL
;
int
status
=
0
;
pid_t
pid
=
fork
();
ICUNIT_ASSERT_WITHIN_EQUAL
(
pid
,
0
,
INVALID_PROCESS_ID
,
pid
);
if
(
pid
==
0
)
{
*
test
=
0x1
;
exit
(
0
);
}
...
...
@@ -54,7 +52,6 @@ static int TestCase(void)
pid
=
fork
();
ICUNIT_ASSERT_WITHIN_EQUAL
(
pid
,
0
,
INVALID_PROCESS_ID
,
pid
);
if
(
pid
==
0
)
{
*
test
=
0x1
;
exit
(
0
);
}
...
...
testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp
浏览文件 @
f34762c1
...
...
@@ -35,19 +35,15 @@
static
int
TestThread
(
void
)
{
int
*
test
=
nullptr
;
int
ret
;
pid_t
pid
=
fork
();
ICUNIT_ASSERT_WITHIN_EQUAL
(
pid
,
0
,
INVALID_PROCESS_ID
,
pid
);
if
(
pid
==
0
)
{
*
test
=
0x1
;
while
(
1
)
{
}
}
*
test
=
0x1
;
ret
=
waitpid
(
pid
,
NULL
,
0
);
ICUNIT_ASSERT_EQUAL
(
ret
,
pid
,
ret
);
...
...
@@ -56,7 +52,6 @@ static int TestThread(void)
static
int
TestCase
(
void
)
{
int
*
test
=
nullptr
;
int
count
=
5
;
int
status
=
0
;
int
ret
;
...
...
testsuites/unittest/extended/signal/smoke/mkfifo_test_001.cpp
浏览文件 @
f34762c1
...
...
@@ -59,7 +59,7 @@ static int TestMkfifo()
if
(
fd
<
0
)
{
return
-
1
;
}
write
(
fd
,
sentence
,
sizeof
(
sentence
)
+
1
);
write
(
fd
,
sentence
,
sizeof
(
sentence
));
close
(
fd
);
exit
(
0
);
}
else
{
...
...
testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp
浏览文件 @
f34762c1
...
...
@@ -45,7 +45,6 @@ static int TestMkfifoReturn()
int
retValue
,
i
;
int
status
=
0
;
pid_t
pid
;
char
pathname
[
NAME_BUF_SIZE
];
retValue
=
mkfifo
(
"/dev/fifo0"
,
0777
);
// 0777, mkfifo config.
ICUNIT_ASSERT_EQUAL
(
retValue
,
0
,
retValue
);
...
...
@@ -57,7 +56,6 @@ static int TestMkfifoReturn()
unlink
(
"/dev/fifo0/fifo1"
);
unlink
(
"/dev/usr/fifo0"
);
rmdir
(
"/dev/usr"
);
unlink
(
pathname
);
unlink
(
"/dev/fifo0"
);
return
LOS_OK
;
...
...
@@ -66,7 +64,6 @@ EXIT:
unlink
(
"/dev/fifo0/fifo1"
);
unlink
(
"/dev/usr/fifo0"
);
rmdir
(
"/dev/usr"
);
unlink
(
pathname
);
unlink
(
"/dev/fifo0"
);
return
LOS_NOK
;
}
...
...
testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp
浏览文件 @
f34762c1
...
...
@@ -54,7 +54,7 @@ static UINT32 testcase(VOID)
UINT32
ret
;
retval
=
pipe
(
pipeFd
);
ICUNIT_GOTO_EQUAL
(
retval
,
0
,
retval
,
OUT
);
ICUNIT_GOTO_EQUAL
(
retval
,
0
,
retval
,
OUT
4
);
/* Watch fd to see when it has input. */
FD_ZERO
(
&
rfds
);
...
...
@@ -62,11 +62,11 @@ static UINT32 testcase(VOID)
/* Wait up to three seconds. */
epFd
=
epoll_create1
(
100
);
/* 100, cretae input, */
ICUNIT_GOTO_NOT_EQUAL
(
epFd
,
-
1
,
epFd
,
OUT
);
ICUNIT_GOTO_NOT_EQUAL
(
epFd
,
-
1
,
epFd
,
OUT
2
);
ev
.
events
=
EPOLLIN
|
EPOLLOUT
|
EPOLLRDNORM
|
EPOLLWRNORM
;
retval
=
epoll_ctl
(
epFd
,
EPOLL_CTL_ADD
,
pipeFd
[
0
],
&
ev
);
ICUNIT_GOTO_NOT_EQUAL
(
retval
,
-
1
,
retval
,
OUT
);
ICUNIT_GOTO_NOT_EQUAL
(
retval
,
-
1
,
retval
,
OUT
1
);
pid
=
fork
();
if
(
pid
==
0
)
{
...
...
@@ -86,7 +86,7 @@ static UINT32 testcase(VOID)
sleep
(
1
);
close
(
pipeFd
[
0
]);
retval
=
write
(
pipeFd
[
1
],
"0123456789012345678901234567890123456789"
,
40
);
/* write 40 bytes to stdin(fd 0) */
ICUNIT_GOTO_EQUAL
(
retval
,
40
,
retval
,
OUT
);
ICUNIT_GOTO_EQUAL
(
retval
,
40
,
retval
,
OUT
3
);
close
(
pipeFd
[
1
]);
wait
(
&
status
);
...
...
@@ -95,10 +95,20 @@ static UINT32 testcase(VOID)
}
return
LOS_OK
;
OUT:
OUT1:
close
(
epFd
);
close
(
pipeFd
[
0
]);
close
(
pipeFd
[
1
]);
return
LOS_NOK
;
OUT2:
close
(
pipeFd
[
0
]);
close
(
pipeFd
[
1
]);
return
LOS_NOK
;
OUT3:
close
(
epFd
);
close
(
pipeFd
[
1
]);
return
LOS_NOK
;
OUT4:
return
LOS_NOK
;
}
...
...
testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp
浏览文件 @
f34762c1
...
...
@@ -53,7 +53,7 @@ static UINT32 testcase(VOID)
int
i
=
0
;
int
status
;
int
epFd
;
int
epFd
=
0
;
sigset_t
mask
;
void
(
*
retSig
)(
int
);
struct
epoll_event
ev
;
...
...
@@ -75,7 +75,7 @@ static UINT32 testcase(VOID)
ICUNIT_ASSERT_EQUAL
(
retval
,
0
,
retval
);
retval
=
pipe
(
pipeFd
);
ICUNIT_GOTO_EQUAL
(
retval
,
0
,
retval
,
OUT
);
ICUNIT_GOTO_EQUAL
(
retval
,
0
,
retval
,
OUT
3
);
/* Watch fd to see when it has input. */
FD_ZERO
(
&
rfds
);
...
...
@@ -86,12 +86,12 @@ static UINT32 testcase(VOID)
tv
.
tv_nsec
=
5
;
/* 5, wait timer, nano second */
epFd
=
epoll_create1
(
100
);
/* 100, cretae input, */
ICUNIT_GOTO_NOT_EQUAL
(
epFd
,
-
1
,
epFd
,
OUT
);
ICUNIT_GOTO_NOT_EQUAL
(
epFd
,
-
1
,
epFd
,
OUT
2
);
ev
.
events
=
EPOLLRDNORM
;
retval
=
epoll_ctl
(
epFd
,
EPOLL_CTL_ADD
,
pipeFd
[
0
],
&
ev
);
ICUNIT_GOTO_NOT_EQUAL
(
retval
,
-
1
,
retval
,
OUT
);
ICUNIT_GOTO_NOT_EQUAL
(
retval
,
-
1
,
retval
,
OUT
1
);
pid
=
fork
();
if
(
pid
==
0
)
{
...
...
@@ -125,10 +125,12 @@ static UINT32 testcase(VOID)
}
return
LOS_OK
;
OUT:
OUT1:
close
(
epFd
);
OUT2:
close
(
pipeFd
[
0
]);
close
(
pipeFd
[
1
]);
close
(
epFd
);
OUT3:
return
LOS_NOK
;
}
...
...
testsuites/unittest/process/basic/process/smoke/process_test_002.cpp
浏览文件 @
f34762c1
...
...
@@ -36,7 +36,7 @@ static int Testcase()
#define CURRENT_PROCESS_POLICY SCHED_RR
struct
sched_param
param
=
{
0
};
int
ret
;
int
ret
=
OS_ERROR
;
int
currProcessPri
=
getpriority
(
PRIO_PROCESS
,
getpid
());
ICUNIT_GOTO_WITHIN_EQUAL
(
currProcessPri
,
0
,
31
,
currProcessPri
,
ERROR_OUT
);
// 31, assert function Result equal to this.
...
...
testsuites/unittest/process/basic/process/smoke/process_test_013.cpp
浏览文件 @
f34762c1
...
...
@@ -35,7 +35,7 @@ static int TestCase()
{
#define PROCESS_TEST_PRI1 (currProcessPri + 1)
struct
sched_param
param
=
{
0
};
int
ret
;
int
ret
=
OS_ERROR
;
int
val
,
currPolicy
;
int
currProcessPri
=
getpriority
(
PRIO_PROCESS
,
getpid
());
ICUNIT_GOTO_WITHIN_EQUAL
(
currProcessPri
,
0
,
31
,
currProcessPri
,
ERROR_OUT
);
// 31, assert currProcessPri equal to this.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录