fix: codex 清理
Close #I4BL3S Signed-off-by: Far <yesiyuan2@huawei.com>
This commit is contained in:
parent
ecd9ca7781
commit
9ab3e351d3
|
@ -404,6 +404,8 @@ int VnodeLookupAt(const char *path, struct Vnode **result, uint32_t flags, struc
|
||||||
*result = currentVnode;
|
*result = currentVnode;
|
||||||
if (currentVnode->filePath == NULL) {
|
if (currentVnode->filePath == NULL) {
|
||||||
currentVnode->filePath = normalizedPath;
|
currentVnode->filePath = normalizedPath;
|
||||||
|
} else {
|
||||||
|
free(normalizedPath);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
} else if (VfsVnodePermissionCheck(currentVnode, EXEC_OP)) {
|
} else if (VfsVnodePermissionCheck(currentVnode, EXEC_OP)) {
|
||||||
|
|
|
@ -76,6 +76,10 @@ static int OsELFClose(int procFd)
|
||||||
int ret;
|
int ret;
|
||||||
/* Process procfd convert to system global procfd */
|
/* Process procfd convert to system global procfd */
|
||||||
int sysfd = DisassociateProcessFd(procFd);
|
int sysfd = DisassociateProcessFd(procFd);
|
||||||
|
if (sysfd < 0) {
|
||||||
|
return -EBADF;
|
||||||
|
}
|
||||||
|
|
||||||
ret = close(sysfd);
|
ret = close(sysfd);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
AssociateSystemFd(procFd, sysfd);
|
AssociateSystemFd(procFd, sysfd);
|
||||||
|
@ -120,6 +124,10 @@ STATIC INT32 OsReadELFInfo(INT32 procfd, UINT8 *buffer, size_t readSize, off_t o
|
||||||
ssize_t byteNum;
|
ssize_t byteNum;
|
||||||
off_t returnPos;
|
off_t returnPos;
|
||||||
INT32 fd = GetAssociatedSystemFd(procfd);
|
INT32 fd = GetAssociatedSystemFd(procfd);
|
||||||
|
if (fd < 0) {
|
||||||
|
PRINT_ERR("%s[%d], Invalid procfd!\n", __FUNCTION__, __LINE__);
|
||||||
|
return LOS_NOK;
|
||||||
|
}
|
||||||
|
|
||||||
if (readSize > 0) {
|
if (readSize > 0) {
|
||||||
returnPos = lseek(fd, offset, SEEK_SET);
|
returnPos = lseek(fd, offset, SEEK_SET);
|
||||||
|
@ -218,6 +226,8 @@ STATIC INT32 OsReadEhdr(const CHAR *fileName, ELFInfo *elfInfo, BOOL isExecFile)
|
||||||
ret = fs_getfilep(GetAssociatedSystemFd(elfInfo->procfd), &OsCurrProcessGet()->execFile);
|
ret = fs_getfilep(GetAssociatedSystemFd(elfInfo->procfd), &OsCurrProcessGet()->execFile);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
PRINT_ERR("%s[%d], Failed to get struct file %s!\n", __FUNCTION__, __LINE__, fileName);
|
PRINT_ERR("%s[%d], Failed to get struct file %s!\n", __FUNCTION__, __LINE__, fileName);
|
||||||
|
/* File will be closed by OsLoadELFFile */
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue