Compare commits

..

No commits in common. "master" and "OpenHarmony_debug_20240926" have entirely different histories.

4 changed files with 13 additions and 27 deletions

View File

@ -61,7 +61,7 @@ static ssize_t MemMap(struct file *filep, LosVmMapRegion *region)
VADDR_T vaddr = region->range.base;
LosVmSpace *space = LOS_SpaceGet(vaddr);
if (((paddr + size) >= SYS_MEM_BASE) && (paddr < SYS_MEM_END)) {
if ((paddr >= SYS_MEM_BASE) && (paddr < SYS_MEM_END)) {
return -EINVAL;
}

View File

@ -220,18 +220,14 @@ int epoll_close(int epfd)
{
struct epoll_head *epHead = NULL;
(VOID)pthread_mutex_lock(&g_epollMutex);
epHead = EpollGetDataBuff(epfd);
if (epHead == NULL) {
(VOID)pthread_mutex_unlock(&g_epollMutex);
set_errno(EBADF);
return -1;
}
DoEpollClose(epHead);
int ret = EpollFreeSysFd(epfd);
(VOID)pthread_mutex_unlock(&g_epollMutex);
return ret;
return EpollFreeSysFd(epfd);
}
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
@ -240,16 +236,15 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
int i;
int ret = -1;
(VOID)pthread_mutex_lock(&g_epollMutex);
epHead = EpollGetDataBuff(epfd);
if (epHead == NULL) {
set_errno(EBADF);
goto OUT_RELEASE;
return ret;
}
if (ev == NULL) {
set_errno(EINVAL);
goto OUT_RELEASE;
return -1;
}
switch (op) {
@ -257,19 +252,18 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
ret = CheckFdExist(epHead, fd);
if (ret == -1) {
set_errno(EEXIST);
goto OUT_RELEASE;
return -1;
}
if (epHead->nodeCount == EPOLL_DEFAULT_SIZE) {
set_errno(ENOMEM);
goto OUT_RELEASE;
return -1;
}
epHead->evs[epHead->nodeCount].events = ev->events | POLLERR | POLLHUP;
epHead->evs[epHead->nodeCount].data.fd = fd;
epHead->nodeCount++;
ret = 0;
break;
return 0;
case EPOLL_CTL_DEL:
for (i = 0; i < epHead->nodeCount; i++) {
if (epHead->evs[i].data.fd != fd) {
@ -281,29 +275,23 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
epHead->nodeCount - i);
}
epHead->nodeCount--;
ret = 0;
goto OUT_RELEASE;
return 0;
}
set_errno(ENOENT);
break;
return -1;
case EPOLL_CTL_MOD:
for (i = 0; i < epHead->nodeCount; i++) {
if (epHead->evs[i].data.fd == fd) {
epHead->evs[i].events = ev->events | POLLERR | POLLHUP;
ret = 0;
goto OUT_RELEASE;
return 0;
}
}
set_errno(ENOENT);
break;
return -1;
default:
set_errno(EINVAL);
break;
return -1;
}
OUT_RELEASE:
(VOID)pthread_mutex_unlock(&g_epollMutex);
return ret;
}
int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout)

View File

@ -689,9 +689,6 @@ INT32 ShmCtl(INT32 shmid, INT32 cmd, struct shmid_ds *buf)
(shm_perm.mode & ACCESSPERMS);
seg->ds.shm_ctime = time(NULL);
#ifdef LOSCFG_SHELL
if (OsProcessIDUserCheckInvalid(shm_perm.uid)) {
break;
}
(VOID)memcpy_s(seg->ownerName, OS_PCB_NAME_LEN, OS_PCB_FROM_PID(shm_perm.uid)->processName,
OS_PCB_NAME_LEN);
#endif

View File

@ -278,6 +278,7 @@ static void DumpFaultLog(void)
static void DumpMemData(struct MemDumpParam *param)
{
PRINTK("\nDumpType: %d\n", param->type);
PRINTK("Unsupported now!\n");
}