From bcf3381d06fdd9ab8f7a29f94d564e820939b679 Mon Sep 17 00:00:00 2001 From: dongjiuzhu Date: Tue, 29 Sep 2020 18:04:45 +0800 Subject: [PATCH] epoll_create: mofidy return value for epoll_create1 Change-Id: I422d7640c37105e1120db18b29d56547f447846f Signed-off-by: dongjiuzhu --- fs/vfs/fs_epoll.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/vfs/fs_epoll.c b/fs/vfs/fs_epoll.c index f5b1f1105f..4babda57c7 100644 --- a/fs/vfs/fs_epoll.c +++ b/fs/vfs/fs_epoll.c @@ -114,7 +114,8 @@ int epoll_create1(int flags) if (flags != EPOLL_CLOEXEC) { - return EINVAL; + set_errno(EINVAL); + return -1; } return epoll_create(CONFIG_FS_NEPOLL_DESCRIPTORS); @@ -193,7 +194,8 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev) } } - return -ENOENT; + set_errno(ENOENT); + return -1; } case EPOLL_CTL_MOD: @@ -213,11 +215,13 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev) } } - return -ENOENT; + set_errno(ENOENT); + return -1; } } - return -EINVAL; + set_errno(EINVAL); + return -1; } /****************************************************************************