From: hcj <1224667075@qq.com> Date: Fri, 26 Dec 2025 09:58:25 +0000 (+0800) Subject: 修改socket起点fd,修复关闭socket异常 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=901e883bc83f9ece4b2ece3d65b3424d35a139d7;p=mirrors%2FFD230.git 修改socket起点fd,修复关闭socket异常 --- diff --git a/code/sdk/middleware/utils/fs/vfs/nuttx_fs/vfs/operation/fs_close.c b/code/sdk/middleware/utils/fs/vfs/nuttx_fs/vfs/operation/fs_close.c index c349a4a9a..63b88c7cd 100644 --- a/code/sdk/middleware/utils/fs/vfs/nuttx_fs/vfs/operation/fs_close.c +++ b/code/sdk/middleware/utils/fs/vfs/nuttx_fs/vfs/operation/fs_close.c @@ -78,7 +78,7 @@ * Assumptions: * ****************************************************************************/ - +extern int lwip_close(int s); int close(int fd) { int errcode; @@ -90,10 +90,10 @@ int close(int fd) { /* Close a socket descriptor */ -#if defined(CONFIG_NET_LWIP_SACK) - if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) +#if 1 + if (1) { - ret = closesocket(fd); + ret = lwip_close(fd); if (ret < 0) { errcode = -ret; diff --git a/code/sdk/open_source/openharmony/third_party/lwip/lwip_adapter/liteos/src/include/lwip/lwipopts_default.h b/code/sdk/open_source/openharmony/third_party/lwip/lwip_adapter/liteos/src/include/lwip/lwipopts_default.h index 0bee4e3f5..e5d6a5c42 100644 --- a/code/sdk/open_source/openharmony/third_party/lwip/lwip_adapter/liteos/src/include/lwip/lwipopts_default.h +++ b/code/sdk/open_source/openharmony/third_party/lwip/lwip_adapter/liteos/src/include/lwip/lwipopts_default.h @@ -426,7 +426,7 @@ extern "C" { #if defined (LOSCFG_CONFIG_MQTT) #ifndef CONFIG_NFILE_DESCRIPTORS -#define CONFIG_NFILE_DESCRIPTORS 1 +#define CONFIG_NFILE_DESCRIPTORS 128 #endif #endif @@ -1217,7 +1217,7 @@ extern "C" { #endif #ifndef LWIP_COMPAT_SOCKETS -#define LWIP_COMPAT_SOCKETS 1 +#define LWIP_COMPAT_SOCKETS 2 #define LWIP_POSIX_SOCKETS_IO_NAMES 0 #endif