1 Star 0 Fork 32

zhangju1/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0080-fix-example-print-error.patch 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
yinbin6 提交于 2023-12-09 23:07 . sync upstream patch
From 881bf800f35c79f778b1cdb401ad7ff780b010e9 Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
Date: Wed, 6 Dec 2023 12:23:51 +0800
Subject: [PATCH] fix example print error
---
src/lstack/api/lstack_epoll.c | 7 +------
src/lstack/api/lstack_wrap.c | 4 ++++
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index a2d2a9b..7825bed 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -941,12 +941,7 @@ static nfds_t fds_select2poll(int maxfd, fd_set *readfds, fd_set *writefds, fd_s
int lstack_select(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeval)
{
- if (maxfd == 0) {
- LSTACK_LOG(ERR, LSTACK, "select maxfd is zero\n");
- return 0;
- }
-
- if (maxfd < 0 || maxfd > FD_SETSIZE || (readfds == NULL && writefds == NULL && exceptfds == NULL)) {
+ if (maxfd < 0 || maxfd > FD_SETSIZE) {
LSTACK_LOG(ERR, LSTACK, "select input param error, fd num=%d\n", maxfd);
GAZELLE_RETURN(EINVAL);
}
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
index abbf8a1..69a1409 100644
--- a/src/lstack/api/lstack_wrap.c
+++ b/src/lstack/api/lstack_wrap.c
@@ -595,6 +595,10 @@ static int32_t do_sigaction(int32_t signum, const struct sigaction *act, struct
static int32_t do_select(int32_t nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
{
+ if ((select_posix_path() == PATH_KERNEL) || !(readfds || writefds || exceptfds) || nfds == 0) {
+ return posix_api->select_fn(nfds, readfds, writefds, exceptfds, timeout);
+ }
+
return posix_api->select_fn(nfds, readfds, writefds, exceptfds, timeout);
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangju1/gazelle.git
git@gitee.com:zhangju1/gazelle.git
zhangju1
gazelle
gazelle
master

搜索帮助