gazelle/0198-fix-do_close-core-dump.patch

26 lines
873 B
Diff
Raw Normal View History

From 545685aed712e781a25ccbc7aeab85ba5d53da9e Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Tue, 7 Mar 2023 08:37:22 +0000
Subject: [PATCH] fix do_close core dump
---
src/lstack/api/lstack_wrap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
index 77d2442..f438529 100644
--- a/src/lstack/api/lstack_wrap.c
+++ b/src/lstack/api/lstack_wrap.c
@@ -440,7 +440,7 @@ static inline ssize_t do_sendmsg(int32_t s, const struct msghdr *message, int32_
static inline int32_t do_close(int32_t s)
{
struct lwip_sock *sock = get_socket_by_fd(s);
- if (sock && sock->wakeup && sock->wakeup->epollfd == s) {
+ if (likely(posix_api->ues_posix == 0) && sock && sock->wakeup && sock->wakeup->epollfd == s) {
return lstack_epoll_close(s);
}
--
2.33.0