gazelle/0144-modify-event-error.patch
compile_success 843b2df32a sync add malloc init zero
(cherry picked from commit c2dfab92ca3569b5ddbb662285fc209c41e7f769)
2022-12-01 23:24:57 +08:00

29 lines
925 B
Diff

From 41a1d215efc76fb07630c15cbe5580466f950f30 Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Tue, 22 Nov 2022 15:31:19 +0000
Subject: [PATCH] modify event error
---
src/lstack/api/lstack_epoll.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index 02889d6..c3fd31c 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -145,9 +145,9 @@ static void raise_pending_events(struct wakeup_poll *wakeup, struct lwip_sock *s
event |= EPOLLERR | EPOLLIN;
}
- sock->events = event;
- if (sock->events) {
+ if (event) {
pthread_spin_lock(&wakeup->event_list_lock);
+ sock->events = event;
if (wakeup->type == WAKEUP_EPOLL && list_is_null(&sock->event_list)) {
list_add_node(&wakeup->event_list, &sock->event_list);
}
--
2.33.0