From b77faf6bac4ab602342e11c456efd9ba2686b5b3 Mon Sep 17 00:00:00 2001 From: yanansong Date: Tue, 21 Nov 2023 15:24:20 +0800 Subject: [PATCH] fixbug: fd leak (cherry picked from commit dea70aba22b32d1e2356d8c04b4d67654dff353d) --- 0015_fixbug_fd_leak_for_init.patch | 12 ++++++++++++ distributed-utils.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 0015_fixbug_fd_leak_for_init.patch diff --git a/0015_fixbug_fd_leak_for_init.patch b/0015_fixbug_fd_leak_for_init.patch new file mode 100644 index 0000000..3bb9379 --- /dev/null +++ b/0015_fixbug_fd_leak_for_init.patch @@ -0,0 +1,12 @@ +diff --git a/services/param/linux/param_request.c b/services/param/linux/param_request.c +index 460486d..6bcd72d 100644 +--- a/services/param/linux/param_request.c ++++ b/services/param/linux/param_request.c +@@ -50,6 +50,7 @@ static int GetClientSocket() + serverAddr.sun_family = PF_UNIX; + strncpy(serverAddr.sun_path, PIPE_NAME, strlen(PIPE_NAME)); + if (connect(cfd, (struct sockaddr*)&serverAddr, sizeof(serverAddr)) < 0) { ++ close(cfd); + perror("Failed to connect"); + return -1; + } diff --git a/distributed-utils.spec b/distributed-utils.spec index 21f3b17..3d29b8c 100644 --- a/distributed-utils.spec +++ b/distributed-utils.spec @@ -23,7 +23,7 @@ Name: distributed-utils Version: 1.0.0 -Release: 5 +Release: 6 Summary: Distributed middleware used components. License: Apache-2.0 and MIT Url: https://gitee.com/openharmony/ @@ -60,6 +60,7 @@ Patch11: 0011-remove-dependency-and-adapt-for-build-device_manager.patch Patch12: 0012-remove-dependency-and-adapt-for-build-device_security_level.patch Patch13: 0013-increase-the-pthread-stack-size-of-x86-and-other-env-dsoftbus.patch Patch14: 0014-fixbug-metaDescriptor-for-ipc.patch +Patch15: 0015_fixbug_fd_leak_for_init.patch BuildRequires: python3-jinja2 python3-pyyaml cjson cjson-devel BuildRequires: libatomic libicu-devel libxml2-devel openssl-devel @@ -117,6 +118,7 @@ rm -rf %{_builddir}/third_party/mbedtls/* %patch12 -p1 -d %{device_security_level_dir} %patch13 -p1 -d %{dsoftbus_dir} %patch14 -p1 -d %{ipc_dir} +%patch15 -p1 -d %{init_dir} # build all components with build.sh %build @@ -215,6 +217,9 @@ cp -rvf single_include/nlohmann %{buildroot}/%{_includedir}/nlohmann_json/single /usr/bin/* %changelog +* Tue Nov 21 2023 yanansong - 1.0.0-6 +- fixbug fd leak for init module. + * Fri Oct 27 2023 yanansong - 1.0.0-5 - fixbug metaDescriptor initialization. -- Gitee