From 53788fe3cf1033a38f69bcdc3de941fd43d19abe Mon Sep 17 00:00:00 2001 From: zhongning5 Date: Tue, 23 Apr 2024 10:50:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dupdater=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhongning5 --- services/init/init_group_manager.c | 4 +++- services/init/init_service_manager.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/services/init/init_group_manager.c b/services/init/init_group_manager.c index cf63d3a46..63300baa5 100644 --- a/services/init/init_group_manager.c +++ b/services/init/init_group_manager.c @@ -29,7 +29,9 @@ ServiceSocket* GetOnDemandSocketList(void) void AddOnDemandSocket(ServiceSocket *socketNode) { - return; + INIT_ERROR_CHECK(socketNode != NULL, return, "socketNode is NULL!"); + socketNode->nextNode = g_initWorkspace.serviceSocketNode; + g_initWorkspace.serviceSocketNode = socketNode; } void RemoveOnDemandSocket(ServiceSocket *sockopt) diff --git a/services/init/init_service_manager.c b/services/init/init_service_manager.c index e2e43ecf9..30e724fe8 100755 --- a/services/init/init_service_manager.c +++ b/services/init/init_service_manager.c @@ -67,6 +67,8 @@ static void FreeServiceArg(ServiceArgs *arg) static void FreeServiceSocket(ServiceSocket *sockopt) { + // remove service socket list head node from OnDemand socket list before free OnDemand service socket + RemoveOnDemandSocket(sockopt); while (sockopt != NULL) { ServiceSocket *tmp = sockopt; if (tmp->sockFd >= 0) { @@ -156,8 +158,6 @@ void ReleaseService(Service *service) } service->servPerm.gIDCnt = 0; - // remove service socket list head node from OnDemand socket list before free OnDemand service socket - RemoveOnDemandSocket(service->socketCfg); FreeServiceSocket(service->socketCfg); FreeServiceFile(service->fileCfg);