vfs/epoll: Fix one bug of EPOLL_CTL_DEL.

N/A

Signed-off-by: buyuer <dingddding@163.com>
This commit is contained in:
buyuer 2021-03-12 15:52:55 +08:00 committed by Xiang Xiao
parent c0f9c7b48c
commit 3b23f3f0b8

View File

@ -275,7 +275,7 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
{
if (eph->poll[i].fd == fd)
{
if (i != eph->occupied - 1)
if (i != eph->occupied)
{
memmove(&eph->data[i], &eph->data[i + 1],
sizeof(epoll_data_t) * (eph->occupied - i));