代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From e69c39c7c73abd1245c1f7aecde3333fdb45ca2b Mon Sep 17 00:00:00 2001
From: hantwofish <hankangkang5@huawei.com>
Date: Sat, 18 Nov 2023 17:07:32 +0800
Subject: [PATCH] modif mem
---
src/lstack/api/lstack_epoll.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index f2c4a8b..7572918 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -910,9 +910,9 @@ static inline int timeval_to_ms(struct timeval *timeval)
return (timeval->tv_sec * 1000 + timeval->tv_usec / 1000);
}
-static nfds_t fds_select2poll(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct pollfd **fds)
+static nfds_t fds_select2poll(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct pollfd *fds)
{
- struct pollfd pollfds[FD_SETSIZE] = { 0 };
+ struct pollfd *pollfds = fds;
nfds_t nfds = 0;
for (int i = 0; i < maxfd; i++) {
@@ -930,8 +930,6 @@ static nfds_t fds_select2poll(int maxfd, fd_set *readfds, fd_set *writefds, fd_s
nfds++;
}
}
-
- *fds = pollfds;
return nfds;
}
@@ -946,8 +944,8 @@ int lstack_select(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *exceptfd
}
/* Convert the select parameter to the poll parameter. */
- struct pollfd *fds = NULL;
- nfds_t nfds = fds_select2poll(maxfd, readfds, writefds, exceptfds, &fds);
+ struct pollfd fds[FD_SETSIZE] = { 0 };
+ nfds_t nfds = fds_select2poll(maxfd, readfds, writefds, exceptfds, fds);
int timeout = timeval_to_ms(timeval);
int event_num = lstack_poll(fds, nfds, timeout);
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。