From 61888e1e0d4810d3f0dbe5aa1d43a2dbcf2ad0f5 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Wed, 21 Feb 2024 07:44:59 +0800
Subject: [PATCH] readv return -1, errno is EAGAIN when recvring no data

---
 src/lstack/api/lstack_rtw_api.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/lstack/api/lstack_rtw_api.c b/src/lstack/api/lstack_rtw_api.c
index 8498b8e..e50fe37 100644
--- a/src/lstack/api/lstack_rtw_api.c
+++ b/src/lstack/api/lstack_rtw_api.c
@@ -127,12 +127,7 @@ ssize_t rtw_readv(int s, const struct iovec *iov, int iovcnt)
     msg.msg_control = NULL;
     msg.msg_controllen = 0;
     msg.msg_flags = 0;
-    ssize_t result = do_lwip_recvmsg_from_stack(s, &msg, 0);
-    if (result == -1 && errno == EAGAIN) {
-        errno = 0;
-        return 0;
-    }
-    return result;
+    return do_lwip_recvmsg_from_stack(s, &msg, 0);
 }
 
 ssize_t rtw_write(int s, const void *mem, size_t size)
-- 
2.27.0

