fs/epoll: correct the return value of epoll_ctl(2)
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
9800256507
commit
4abf8e6587
@ -283,13 +283,18 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
|
||||
sizeof(struct pollfd) * (eph->occupied - i));
|
||||
}
|
||||
|
||||
eph->occupied--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
set_errno(ENOENT);
|
||||
return -1;
|
||||
if (i > eph->occupied)
|
||||
{
|
||||
set_errno(ENOENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
eph->occupied--;
|
||||
break;
|
||||
|
||||
case EPOLL_CTL_MOD:
|
||||
finfo("%08x CTL MOD(%d): fd=%d ev=%08" PRIx32 "\n",
|
||||
@ -304,8 +309,13 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
|
||||
}
|
||||
}
|
||||
|
||||
set_errno(ENOENT);
|
||||
return -1;
|
||||
if (i > eph->occupied)
|
||||
{
|
||||
set_errno(ENOENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
set_errno(EINVAL);
|
||||
|
Loading…
Reference in New Issue
Block a user