From 96e000b4505b4377078061a453d19279875f0ede Mon Sep 17 00:00:00 2001 From: Zheng Yongjun Date: Thu, 3 Mar 2022 20:00:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E9=97=AE?= =?UTF-8?q?=E9=A2=98=201.=E6=8B=BC=E5=86=99=E9=97=AE=E9=A2=98=202.?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=9D=83=E9=99=90=E4=B8=8D=E5=AF=B9=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=203.=E8=A1=A8=E8=BE=BE=E5=BC=8F=E7=9A=84?= =?UTF-8?q?=E7=AE=80=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zheng Yongjun --- BUILD.gn | 0 README_zh.md | 0 appspawn.cfg | 0 interfaces/innerkits/BUILD.gn | 0 interfaces/innerkits/include/client_socket.h | 2 +- src/appspawn_server.cpp | 8 ++++---- src/include/appspawn_msg_peer.h | 2 +- src/include/appspawn_server.h | 4 ++-- src/include/server_socket.h | 2 +- src/socket/appspawn_socket.cpp | 0 test/unittest/app_spawn_server_test/BUILD.gn | 0 11 files changed, 9 insertions(+), 9 deletions(-) mode change 100755 => 100644 BUILD.gn mode change 100755 => 100644 README_zh.md mode change 100755 => 100644 appspawn.cfg mode change 100755 => 100644 interfaces/innerkits/BUILD.gn mode change 100755 => 100644 src/socket/appspawn_socket.cpp mode change 100755 => 100644 test/unittest/app_spawn_server_test/BUILD.gn diff --git a/BUILD.gn b/BUILD.gn old mode 100755 new mode 100644 diff --git a/README_zh.md b/README_zh.md old mode 100755 new mode 100644 diff --git a/appspawn.cfg b/appspawn.cfg old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/include/client_socket.h b/interfaces/innerkits/include/client_socket.h index dc459bc7..85e979a6 100644 --- a/interfaces/innerkits/include/client_socket.h +++ b/interfaces/innerkits/include/client_socket.h @@ -29,7 +29,7 @@ public: explicit ClientSocket(const std::string &client); /** - * Destructor used to destory a ClientSocket + * Destructor used to destroy a ClientSocket */ virtual ~ClientSocket() = default; diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp index df76ef36..e8f61665 100644 --- a/src/appspawn_server.cpp +++ b/src/appspawn_server.cpp @@ -298,7 +298,7 @@ int AppSpawnServer::DoColdStartApp(ClientSocket::AppProperty *appProperty, int f extractedCmds.push_back(nullptr); APPSPAWN_LOGI("DoColdStartApp extractedCmds %d", extractedCmds.size()); int ret = execv(extractedCmds[0], extractedCmds.data()); - if (ret != 0) { + if (ret) { HiLog::Error(LABEL, "Failed to execv, errno = %{public}d", errno); NotifyResToParentProc(fd, -1); } @@ -386,7 +386,7 @@ bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen) ClientSocket::AppProperty *appProperty = msg->GetMsg(); pid_t pid = 0; int ret = StartApp(longProcName, longProcNameLen, appProperty, connectFd, pid); - if (ret != 0) { + if (ret) { msg->Response(ret); } else { msg->Response(pid); @@ -723,7 +723,7 @@ int32_t AppSpawnServer::DoSandboxRootFolderCreateAdapt(std::string sandboxPackag } // bind mount "/" to /mnt/sandbox/ path - // rootfs: to do more resouces bind mount here to get more strict resources constraints + // rootfs: to do more resources bind mount here to get more strict resources constraints rc = mount("/", sandboxPackagePath.c_str(), NULL, MS_BIND | MS_REC, NULL); if (rc) { HiLog::Error(LABEL, "mount bind / failed"); @@ -867,7 +867,7 @@ void AppSpawnServer::SetAppAccessToken(const ClientSocket::AppProperty *appPrope #ifdef WITH_SELINUX HapContext hapContext; ret = hapContext.HapDomainSetcontext(appProperty->apl, appProperty->processName); - if (ret != 0) { + if (ret) { HiLog::Error(LABEL, "AppSpawnServer::Failed to hap domain set context, errno = %{public}d %{public}s", errno, appProperty->apl); } else { diff --git a/src/include/appspawn_msg_peer.h b/src/include/appspawn_msg_peer.h index 0aa10c19..d81b124d 100644 --- a/src/include/appspawn_msg_peer.h +++ b/src/include/appspawn_msg_peer.h @@ -37,7 +37,7 @@ public: AppSpawnMsgPeer(const std::shared_ptr &socket, int connectFd); /** - * Destructor used to destory a AppSpawnMsgPeer + * Destructor used to destroy a AppSpawnMsgPeer */ ~AppSpawnMsgPeer(); diff --git a/src/include/appspawn_server.h b/src/include/appspawn_server.h index 694b3e43..09eb0fad 100644 --- a/src/include/appspawn_server.h +++ b/src/include/appspawn_server.h @@ -39,7 +39,7 @@ public: explicit AppSpawnServer(const std::string &socketName); /** - * Destructor used to destory a AppSpawnServer + * Destructor used to destroy a AppSpawnServer */ ~AppSpawnServer() = default; @@ -93,7 +93,7 @@ private: void ConnectionPeer(); /** - * Sets a name for an applicaiton process. + * Sets a name for an application process. * * @param longProcName Indicates the length of long process name. * @param longProcNameLen Indicates the long process name. diff --git a/src/include/server_socket.h b/src/include/server_socket.h index 84c965cf..8bfe2ce4 100644 --- a/src/include/server_socket.h +++ b/src/include/server_socket.h @@ -34,7 +34,7 @@ public: explicit ServerSocket(const std::string &server); /** - * Destructor used to destory a ServerSocket + * Destructor used to destroy a ServerSocket */ virtual ~ServerSocket(); diff --git a/src/socket/appspawn_socket.cpp b/src/socket/appspawn_socket.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/app_spawn_server_test/BUILD.gn b/test/unittest/app_spawn_server_test/BUILD.gn old mode 100755 new mode 100644 -- Gitee