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

!1465 修改参数检查报错

Merge pull request !1465 from renwei/master
...@@ -211,7 +211,7 @@ int CreateServiceSocket(Service *service) ...@@ -211,7 +211,7 @@ int CreateServiceSocket(Service *service)
while (tmpSock != NULL) { while (tmpSock != NULL) {
PluginExecCmdByName("setSockCreateCon", service->name); PluginExecCmdByName("setSockCreateCon", service->name);
int fd = CreateSocket(tmpSock); int fd = CreateSocket(tmpSock);
PluginExecCmdByName("setSockCreateCon", NULL); PluginExecCmdByName("setSockCreateCon", "");
INIT_CHECK_RETURN_VALUE(fd >= 0, -1); INIT_CHECK_RETURN_VALUE(fd >= 0, -1);
if (IsOnDemandService(service)) { if (IsOnDemandService(service)) {
if (IsConnectionBasedSocket(tmpSock)) { if (IsConnectionBasedSocket(tmpSock)) {
......
...@@ -71,7 +71,7 @@ static int SetServiceContent(int id, const char *name, int argc, const char **ar ...@@ -71,7 +71,7 @@ static int SetServiceContent(int id, const char *name, int argc, const char **ar
static int SetSockCreateCon(int id, const char *name, int argc, const char **argv) static int SetSockCreateCon(int id, const char *name, int argc, const char **argv)
{ {
PLUGIN_CHECK(name != NULL && argc >= 1 && argv != NULL, return -1, "Invalid parameter"); PLUGIN_CHECK(name != NULL && argc >= 1 && argv != NULL, return -1, "Invalid parameter");
if (argv[0] == NULL) { if (strcmp(argv[0], "") == 0) {
setsockcreatecon(NULL); setsockcreatecon(NULL);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册