From 71d64ba594e053fa739bc2f00a0f61db8f9cd17e Mon Sep 17 00:00:00 2001 From: zhangdengyu Date: Sun, 9 Oct 2022 21:01:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201.=E4=BF=AE=E5=A4=8Dlisten=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E8=BF=94=E5=9B=9E=E5=80=BC=E9=97=AE=E9=A2=98=20=20=20?= =?UTF-8?q?=20=20=202.=E4=BF=AE=E6=94=B9kernel/uniproton=E9=A1=B6=E5=B1=82?= =?UTF-8?q?BUILD.gn=E4=B8=AD=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9=20Close:#?= =?UTF-8?q?I5UQJ3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangdengyu Change-Id: Id6b546f4c9b55d330f19d042c3e3a95612019876 --- BUILD.gn | 10 +++++----- src/net/lwip-2.1/src/sockets.c | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index c338e85..46e1779 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,10 +10,10 @@ # See the Mulan PSL v2 for more details. # Create: 2022-09-21 # Description: UniProton内核编译脚本。 -import("//build/ohos.gni") import("//build/lite/config/component/lite_component.gni") -import("//third_party/lwip/lwip.gni") +import("//build/ohos.gni") import("//third_party/littlefs/littlefs.gni") +import("//third_party/lwip/lwip.gni") import("uniproton.gni") declare_args() { @@ -33,7 +33,7 @@ config("arch_config") { config("kconfig_config") { cflags = [ "-imacros", - "$MENUCONFIG_H" + "$MENUCONFIG_H", ] asmflags = cflags cflags_cc = cflags @@ -158,7 +158,7 @@ config("os_config") { ":ssp_config", #":warn_config", - ":strong_waring_flag", + #":strong_waring_flag", ":misc_config", ] @@ -221,7 +221,7 @@ static_library("libkernel") { group("kernel") { deps = [ ":libkernel", - ":notice" + ":notice", ] } diff --git a/src/net/lwip-2.1/src/sockets.c b/src/net/lwip-2.1/src/sockets.c index 126758a..2fcb1f7 100644 --- a/src/net/lwip-2.1/src/sockets.c +++ b/src/net/lwip-2.1/src/sockets.c @@ -93,6 +93,10 @@ int connect(int s, const struct sockaddr *name, socklen_t namelen) int listen(int s, int backlog) { + if (backlog < 0) { + set_errno(EINVAL); + return -1; + } return lwip_listen(s, backlog); }