修复updater模式启动失败问题

Signed-off-by: zhongning5 <zhongning5@huawei.com>
This commit is contained in:
zhongning5 2024-04-23 10:50:11 +08:00
parent 6ad5e98974
commit 53788fe3cf
2 changed files with 5 additions and 3 deletions

View File

@ -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)

View File

@ -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);