未验证 提交 dc2145c9 编写于 作者: O openharmony_ci 提交者: Gitee

!1015 fix:修复parameter set 超时

Merge pull request !1015 from Mupceet/fixset
......@@ -151,18 +151,20 @@ int SystemSetParameter(const char *name, const char *value)
request->msgSize = offset + sizeof(ParamMessage);
request->id.msgId = atomic_fetch_add(&g_requestId, 1);
PARAM_LOGI("SystemSetParameter name %s", name);
PARAM_LOGI("SystemSetParameter name %s msgid:%d ", name, request->id.msgId);
int fd = INVALID_SOCKET;
pthread_mutex_lock(&g_clientMutex);
if (g_clientFd == INVALID_SOCKET) {
g_clientFd = GetClientSocket(DEFAULT_PARAM_SET_TIMEOUT);
}
fd = g_clientFd;
ret = PARAM_CODE_INVALID_PARAM;
if (fd >= 0) {
ret = StartRequest(fd, request, DEFAULT_PARAM_SET_TIMEOUT);
}
PARAM_LOGI("SystemSetParameter name %s msgid:%d ret: %d ", name, request->id.msgId, ret);
pthread_mutex_unlock(&g_clientMutex);
PARAM_CHECK(fd >= 0, return -1, "Failed to connect server for set %s", name);
ret = StartRequest(fd, request, DEFAULT_PARAM_SET_TIMEOUT);
free(request);
PARAM_LOGI("SystemSetParameter name %s %d", name, ret);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册