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

!807 【OpenHarmony开源贡献者计划2022】fix invalid type in OAT.xml and other typos

Merge pull request !807 from c01dface/master
......@@ -63,7 +63,7 @@
<!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/-->
<!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/-->
<!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/-->
<filteritem type="filname" name="*.jpg|*.png|*.gif|*.pdf" desc="already checked"/>
<filteritem type="filename" name="*.jpg|*.png|*.gif|*.pdf" desc="already checked"/>
<filteritem type="filepath" name="services/test/unittest/test_data/proc/*" desc="启动功能UT测试的资源文件"/>
</filefilter>
......
......@@ -43,7 +43,7 @@ static void ProcessFifoWrite(const WatcherHandle taskHandle, int fd, uint32_t *e
}
int fifow = *((int *)context);
if (fifow < 0) {
BEGET_LOGE("[control_fd] invaild fifo write fd");
BEGET_LOGE("[control_fd] invalid fifo write fd");
return;
}
char rbuf[FIFO_BUF_SIZE] = {0};
......
......@@ -95,7 +95,7 @@ static void CmdOnRecvMessage(const TaskHandle task, const uint8_t *buffer, uint3
static int SendMessage(LoopHandle loop, TaskHandle task, const char *message)
{
if (message == NULL) {
BEGET_LOGE("[control_fd] Invaild parameter");
BEGET_LOGE("[control_fd] Invalid parameter");
return -1;
}
BufferHandle handle = NULL;
......@@ -135,7 +135,7 @@ static int CmdOnIncommingConntect(const LoopHandle loop, const TaskHandle server
void CmdServiceInit(const char *socketPath, CallbackControlFdProcess func)
{
if ((socketPath == NULL) || (func == NULL)) {
BEGET_LOGE("[control_fd] Invaild parameter");
BEGET_LOGE("[control_fd] Invalid parameter");
return;
}
LE_StreamServerInfo info = {};
......
......@@ -55,7 +55,7 @@ int BuildControlMessage(struct msghdr *msghdr, int *fds, int fdCount, bool send
cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fdCount);
int ret = memcpy_s(CMSG_DATA(cmsg), cmsg->cmsg_len, fds, sizeof(int) * fdCount);
if (ret != 0) {
BEGET_LOGE("Controll message is not valid");
BEGET_LOGE("Control message is not valid");
free(msghdr->msg_control);
return -1;
}
......@@ -65,7 +65,7 @@ int BuildControlMessage(struct msghdr *msghdr, int *fds, int fdCount, bool send
if (sendUcred) {
if (cmsg == NULL) {
BEGET_LOGE("Controll message is not valid");
BEGET_LOGE("Control message is not valid");
free(msghdr->msg_control);
return -1;
}
......@@ -106,7 +106,7 @@ int *ReceiveFds(int sock, struct iovec iovec, size_t *outFdCount, bool nonblock,
BEGET_ERROR_CHECK(rc >= 0, return NULL, "Failed to get fds from remote, err = %d", errno);
if ((msghdr.msg_flags) & MSG_TRUNC) {
BEGET_LOGE("Message was trucated when receiving fds");
BEGET_LOGE("Message was truncated when receiving fds");
return NULL;
}
......
......@@ -231,7 +231,7 @@ static int GetSandboxInfo(sandbox_t *sandbox, cJSON *root, const char *itemName)
static int ParseSandboxConfig(cJSON *root, sandbox_t *sandbox)
{
BEGET_ERROR_CHECK(!(root == NULL || sandbox == NULL), return -1, "Invaild parameter.");
BEGET_ERROR_CHECK(!(root == NULL || sandbox == NULL), return -1, "Invalid parameter.");
cJSON *sandboxRoot = cJSON_GetObjectItem(root, SANDBOX_ROOT_TAG);
BEGET_ERROR_CHECK(sandboxRoot != NULL, return -1,
......
......@@ -232,7 +232,7 @@ static void AddWatcherCallback(ParamWatcherPtr watcher, napi_ref callbackRef)
static void DelWatcherCallback(ParamWatcherPtr watcher, uint32_t next)
{
PARAM_JS_LOGV("JSApp watcher key %s delete callack %u", watcher->keyPrefix, next);
PARAM_JS_LOGV("JSApp watcher key %s delete callback %u", watcher->keyPrefix, next);
std::lock_guard<std::mutex> lock(watcher->mutex);
watcher->callbackReferences.erase(next);
}
......@@ -490,7 +490,7 @@ static napi_value SwithWatchOn(napi_env env, napi_callback_info info)
{
napi_value callback = nullptr;
ParamWatcherPtr watcher = GetWatcherInfo(env, info, &callback);
PARAM_JS_CHECK(watcher != nullptr, return GetNapiValue(env, -1), "Failed to get watcher swith param");
PARAM_JS_CHECK(watcher != nullptr, return GetNapiValue(env, -1), "Failed to get watcher switch param");
if (CheckCallbackEqual(env, callback, watcher)) {
PARAM_JS_LOGE("JSApp watcher repeater switch on %s", watcher->keyPrefix);
......@@ -553,4 +553,4 @@ napi_value RegisterWatcher(napi_env env, napi_value exports)
napi_set_named_property(env, exports, "paramWatcher", result);
napi_create_reference(env, result, 1, &g_paramWatchRef);
return exports;
}
\ No newline at end of file
}
......@@ -158,7 +158,7 @@ static void ShowParam(BShellHandle shell, const char *name, const char *value)
ParamAuditData auditData = {};
int ret = GetParamSecurityAuditData(name, 0, &auditData);
BSH_CHECK(ret == 0, return, "Failed to get param security for %s", name);
BShellEnvOutput(shell, "Parameter infomation:\r\n");
BShellEnvOutput(shell, "Parameter information:\r\n");
#ifdef PARAM_SUPPORT_SELINUX
BShellEnvOutput(shell, "selinux : %s \r\n", auditData.label);
#endif
......
......@@ -170,10 +170,10 @@ static int main_cmd(BShellHandle shell, int argc, char **argv)
processName = optarg;
break;
case '?':
std::cout << "Invalid arugment\n";
std::cout << "Invalid argument\n";
break;
default:
std::cout << "Invalid arugment\n";
std::cout << "Invalid argument\n";
break;
}
}
......
......@@ -720,7 +720,7 @@ const ParamInfo *BShellEnvGetReservedParam(BShellHandle handle, const char *name
{
BSH_CHECK(handle != NULL, return NULL, "Invalid shell env");
static ParamInfo reservedParams[] = {
{PARAM_REVERESD_NAME_CURR_PARAMETER, "current paramater", PARAM_STRING}
{PARAM_REVERESD_NAME_CURR_PARAMETER, "current parameter", PARAM_STRING}
};
for (size_t i = 0; i < sizeof(reservedParams) / sizeof(reservedParams[0]); i++) {
if (strcmp(name, reservedParams[i].name) == 0) {
......@@ -744,4 +744,4 @@ int32_t BShellEnvDirectExecute(BShellHandle handle, int argc, char *args[])
BShellCmdHelp(handle, argc, args);
}
return 0;
}
\ No newline at end of file
}
......@@ -72,7 +72,7 @@ int main(int argc, char *args[])
return 0;
}
const ParamInfo *param = BShellEnvGetReservedParam(handle, PARAM_REVERESD_NAME_CURR_PARAMETER);
BSH_CHECK(param != NULL && param->type == PARAM_STRING, break, "Failed to get revered param");
BSH_CHECK(param != NULL && param->type == PARAM_STRING, break, "Failed to get reversed param");
BShellEnvSetParam(handle, param->name, param->desc, param->type, (void *)"");
if (argc > 1) {
int ret = SetParamShellPrompt(handle, args[1]);
......
......@@ -173,7 +173,7 @@ static void DoSleep(const struct CmdArgs *ctx)
{
errno = 0;
unsigned long sleepTime = strtoul(ctx->argv[0], NULL, DECIMAL_BASE);
INIT_ERROR_CHECK(errno == 0, return, "cannot covert sleep time in command \" sleep \"");
INIT_ERROR_CHECK(errno == 0, return, "cannot convert sleep time in command \" sleep \"");
// Limit sleep time in 5 seconds
const unsigned long sleepTimeLimit = 5;
......@@ -192,7 +192,7 @@ static void DoWait(const struct CmdArgs *ctx)
errno = 0;
waitSecond = strtoul(ctx->argv[timePos], NULL, DECIMAL_BASE);
INIT_ERROR_CHECK(errno == 0,
return, "cannot covert sleep time in command \" wait \"");
return, "cannot convert sleep time in command \" wait \"");
}
INIT_LOGI("Waiting %s %lu second(s)", ctx->argv[filePos], waitSecond);
......@@ -548,7 +548,7 @@ static void DoSetrlimit(const struct CmdArgs *ctx)
}
}
if (rcs == -1) {
INIT_LOGE("DoSetrlimit failed, resouces :%s not support.", ctx->argv[0]);
INIT_LOGE("DoSetrlimit failed, resources :%s not support.", ctx->argv[0]);
return;
}
INIT_CHECK_ONLY_ELOG(setrlimit(rcs, &limit) == 0, "DoSetrlimit failed : %d", errno);
......
......@@ -106,13 +106,13 @@ static int SetPerms(const Service *service)
}
INIT_ERROR_CHECK(capset(&capHeader, capData) == 0, return SERVICE_FAILURE,
"capset faild for service: %s, error: %d", service->name, errno);
"capset failed for service: %s, error: %d", service->name, errno);
for (unsigned int i = 0; i < service->servPerm.capsCnt; ++i) {
if (service->servPerm.caps[i] == FULL_CAP) {
return SetAllAmbientCapability();
}
INIT_ERROR_CHECK(SetAmbientCapability(service->servPerm.caps[i]) == 0, return SERVICE_FAILURE,
"SetAmbientCapability faild for service: %s", service->name);
"SetAmbientCapability failed for service: %s", service->name);
}
return SERVICE_SUCCESS;
}
......@@ -267,7 +267,7 @@ static void ClearEnvironment(Service *service)
static int InitServicePropertys(Service *service)
{
INIT_ERROR_CHECK(service != NULL, return -1, "Invaild parameter.");
INIT_ERROR_CHECK(service != NULL, return -1, "Invalid parameter.");
SetServiceEnterSandbox(service->pathArgs.argv[0], service->attribute);
INIT_CHECK_ONLY_ELOG(SetAccessToken(service) == SERVICE_SUCCESS, "access token failed %s", service->name);
// deal start job
......@@ -427,7 +427,7 @@ static void CheckServiceSocket(Service *service)
ServiceSocket *tmpSock = service->socketCfg;
while (tmpSock != NULL) {
if (tmpSock->sockFd <= 0) {
INIT_LOGE("Invaid socket %s for service", service->name);
INIT_LOGE("Invalid socket %s for service", service->name);
tmpSock = tmpSock->next;
}
SocketAddWatcher(&tmpSock->watcher, service, tmpSock->sockFd);
......
......@@ -36,7 +36,7 @@
# include "init_selinux_param.h"
#endif // WITH_SELINUX
// All serivce processes that init will fork+exec.
// All service processes that init will fork+exec.
static ServiceSpace g_serviceSpace = { 0 };
static const int CRITICAL_DEFAULT_CRASH_TIME = 20;
// maximum number of crashes within time CRITICAL_DEFAULT_CRASH_TIME for one service
......@@ -1042,7 +1042,7 @@ void StartAllServices(int startMode)
}
node = GetNextGroupNode(NODE_TYPE_SERVICES, node);
}
INIT_LOGI("StartAllServices %d finsh", startMode);
INIT_LOGI("StartAllServices %d finish", startMode);
}
void LoadAccessTokenId(void)
......
......@@ -52,7 +52,7 @@ static int SetSocketAddr(ServiceSocket *sockopt, sockaddr_union *addr)
if (sockopt->family == AF_NETLINK) {
#ifndef __LITEOS_A__
if (memset_s(&(addr->addrnl), sizeof(addr->addrnl), 0, sizeof(addr->addrnl)) != EOK) {
INIT_LOGE("Faild to clear socket address");
INIT_LOGE("Failed to clear socket address");
return -1;
}
addr->addrnl.nl_family = AF_NETLINK;
......
......@@ -116,7 +116,7 @@ static void SendFdsInfo(int sock, Service *service)
};
if (BuildControlMessage(&msghdr, service->fds, service->fdCount, false) < 0) {
SendErrorInfo(sock, "Faild to build send message", service->name);
SendErrorInfo(sock, "Failed to build send message", service->name);
} else {
if (TEMP_FAILURE_RETRY(sendmsg(sock, &msghdr, MSG_NOSIGNAL)) < 0) {
INIT_LOGE("Failed to send fd info to service \' %s \', err = %d", service->name, errno);
......@@ -220,7 +220,7 @@ static void HandlerFdHolder(int sock)
// In this case, ignore fds, just close them if fd passed to init
HandlerGetFds(sock, service);
} else {
INIT_LOGE("Unexpect action: %s", action);
INIT_LOGE("Unexpected action: %s", action);
}
FreeFds(fds);
CloseFds(fds, fdCount);
......
......@@ -74,7 +74,7 @@ static int FdHolderSockInit(void)
addr.sun_family = AF_UNIX;
if (strncpy_s(addr.sun_path, sizeof(addr.sun_path),
INIT_HOLDER_SOCKET_PATH, strlen(INIT_HOLDER_SOCKET_PATH)) != 0) {
INIT_LOGE("Faild to copy fd hoder socket path");
INIT_LOGE("Failed to copy fd hoder socket path");
close(sock);
return -1;
}
......@@ -193,7 +193,7 @@ static void StartInitSecondStage(void)
// If mount required partitions failure.
// There is no necessary to continue.
// Just abort
INIT_LOGE("Mount requried partitions failed; please check fstab file");
INIT_LOGE("Mount required partitions failed; please check fstab file");
// Execute sh for debugging
execv("/bin/sh", NULL);
abort();
......
......@@ -377,7 +377,7 @@ static void DoTimerStart(const struct CmdArgs *ctx)
}
if (count != expectedCount) {
INIT_LOGE("Call timer_start with unexpect arguments %s", arg);
INIT_LOGE("Call timer_start with unexpected arguments %s", arg);
FreeStringVector(splitArgs, count);
return;
}
......@@ -515,7 +515,7 @@ static void DoMkSandbox(const struct CmdArgs *ctx)
const char *sandbox = ctx->argv[0];
if (sandbox == NULL) {
INIT_LOGE("Invaild sandbox name.");
INIT_LOGE("Invalid sandbox name.");
return;
}
InitDefaultNamespace();
......
......@@ -27,7 +27,7 @@
static void ProcessSandboxControlFd(uint16_t type, const char *serviceCmd)
{
if ((type != ACTION_SANDBOX) || (serviceCmd == NULL)) {
INIT_LOGE("Invaild parameter");
INIT_LOGE("Invalid parameter");
return;
}
Service *service = GetServiceByName(serviceCmd);
......
......@@ -118,7 +118,7 @@ static int LoadParamLabels(const char *fileName)
buff[buffSize - 1] = '\0';
int ret = SpliteString(buff, NULL, 0, LoadOneParam_, NULL);
if (ret != 0) {
PARAM_LOGE("Failed to splite string %s fileName %s", buff, fileName);
PARAM_LOGE("Failed to split string %s fileName %s", buff, fileName);
continue;
}
infoCount++;
......@@ -298,4 +298,4 @@ INIT_LOCAL_API void LoadGroupUser(void)
}
PARAM_LOGV("LoadGroupUser getgrent fail errnor %d ", errno);
endgrent();
}
\ No newline at end of file
}
......@@ -142,7 +142,7 @@ static int SystemSetParam(const char *name, const char *value, const ParamSecuri
PARAM_LOGV("SystemWriteParam name %s value: %s", name, value);
int ctrlService = 0;
int ret = CheckParameterSet(name, value, srcLabel, &ctrlService);
PARAM_CHECK(ret == 0, return ret, "Forbit to set parameter %s", name);
PARAM_CHECK(ret == 0, return ret, "Forbid to set parameter %s", name);
if (ctrlService & PARAM_CTRL_SERVICE) { // ctrl param
PostParamTrigger(EVENT_TRIGGER_PARAM, name, value);
......@@ -431,4 +431,4 @@ ParamService *GetParamService()
{
return &g_paramService;
}
#endif
\ No newline at end of file
#endif
......@@ -78,7 +78,7 @@ int SystemSetParameter(const char *name, const char *value)
InitParamClient();
int ctrlService = 0;
int ret = CheckParameterSet(name, value, GetParamSecurityLabel(), &ctrlService);
PARAM_CHECK(ret == 0, return ret, "Forbit to set parameter %s", name);
PARAM_CHECK(ret == 0, return ret, "Forbid to set parameter %s", name);
PARAM_LOGV("SystemSetParameter name %s value: %s ctrlService %d", name, value, ctrlService);
if ((ctrlService & PARAM_CTRL_SERVICE) != PARAM_CTRL_SERVICE) { // ctrl param
uint32_t dataIndex = 0;
......@@ -152,4 +152,4 @@ int SystemFindParameter(const char *name, ParamHandle *handle)
PARAM_CHECK(ret == 0, return ret, "Forbid to access parameter %s", name);
}
return ret;
}
\ No newline at end of file
}
......@@ -63,7 +63,7 @@ static int LoadPersistParam(void)
uint32_t currLen = 0;
while (currLen < fileSize) {
if (buffer[currLen] == '\n') { // splite line
if (buffer[currLen] == '\n') { // split line
buffer[currLen] = '\0';
int ret = SpliteString(buffer, NULL, 0, LoadOnePersistParam_, NULL);
PARAM_CHECK(ret == 0, continue, "Failed to set param %d %s", ret, buffer);
......@@ -160,4 +160,4 @@ int RegisterPersistParamOps(PersistParamOps *ops)
ops->batchSave = BatchSavePersistParam;
ops->batchSaveEnd = BatchSavePersistParamEnd;
return 0;
}
\ No newline at end of file
}
......@@ -48,7 +48,7 @@ int SystemWriteParam(const char *name, const char *value)
{
int ctrlService = 0;
int ret = CheckParameterSet(name, value, GetParamSecurityLabel(), &ctrlService);
PARAM_CHECK(ret == 0, return ret, "Forbit to set parameter %s", name);
PARAM_CHECK(ret == 0, return ret, "Forbid to set parameter %s", name);
PARAM_LOGV("SystemWriteParam name %s value: %s ctrlService %d", name, value, ctrlService);
if ((ctrlService & PARAM_CTRL_SERVICE) != PARAM_CTRL_SERVICE) { // ctrl param
uint32_t dataIndex = 0;
......
......@@ -23,7 +23,7 @@ static int LoadSecurityLabel(const char *fileName)
ParamWorkSpace *paramSpace = GetParamWorkSpace();
PARAM_CHECK(paramSpace != NULL, return -1, "Invalid paramSpace");
PARAM_WORKSPACE_CHECK(paramSpace, return -1, "Invalid space");
PARAM_CHECK(fileName != NULL, return -1, "Invalid fielname for load");
PARAM_CHECK(fileName != NULL, return -1, "Invalid filename for load");
#if !(defined __LITEOS_A__ || defined __LITEOS_M__)
// load security label
ParamSecurityOps *ops = GetParamSecurityOps(PARAM_SECURITY_DAC);
......
......@@ -220,7 +220,7 @@ char **SplitStringExt(char *buffer, const char *del, int *returnCount, int maxIt
{
INIT_CHECK_RETURN_VALUE((maxItemCount >= 0) && (buffer != NULL) && (del != NULL) && (returnCount != NULL), NULL);
// Why is this number?
// Now we use this function to split a string with a given delimeter
// Now we use this function to split a string with a given delimiter
// We do not know how many sub-strings out there after splitting.
// 50 is just a guess value.
const int defaultItemCounts = 50;
......@@ -512,4 +512,4 @@ uint32_t GetRandom()
}
close(fd);
return ulSeed;
}
\ No newline at end of file
}
......@@ -144,7 +144,7 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr
* @param head list head, make sure head is valid pointer.
* @param cookie optional traversing data.
* @param traversalProc comparing function, return 0 if matched.
* @param flags optinal traversing flags:
* @param flags optional traversing flags:
* TRAVERSE_REVERSE_ORDER: traversing from last node to first node;
* default behaviour is from first node to last node
* TRAVERSE_STOP_WHEN_ERROR: stop traversing if traversalProc return non-zero
......
......@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
};
int parameterNum = 2;
if ((argc != parameterNum) || (argv[1] == nullptr)) {
cout << "Invaild parameter" << endl;
cout << "Invalid parameter" << endl;
}
const string name = argv[1];
int abilityId = 0;
......@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
cout << "sa service name " << item->first << "ability id " << item->second << endl;
abilityId = item->second;
} else {
cout << "Invaild sa service name" << endl;
cout << "Invalid sa service name" << endl;
return 0;
}
......
......@@ -194,9 +194,9 @@ HWTEST_F(SandboxUnitTest, TestEnterErrorSandbox, TestSize.Level1) {
HWTEST_F(SandboxUnitTest, TestCreateErrorSandbox1, TestSize.Level1) {
const char *pname = nullptr;
std::cout << "test destory nullptr" << std::endl;
std::cout << "test destroy nullptr" << std::endl;
DestroySandbox(pname);
std::cout << "test destory xapp" << std::endl;
std::cout << "test destroy xapp" << std::endl;
DestroySandbox("xapp");
std::cout << "test enter xapp" << std::endl;
int ret1 = EnterSandbox("xapp");
......
......@@ -45,7 +45,7 @@ const gid_t TEST_FILE_GID = 999;
const mode_t TEST_FILE_MODE = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
#endif
// init.cfg releated
// init.cfg related
const std::string CFG_FILE = "/etc/init.cfg";
const std::string SERVICE_ARR_NAME_IN_JSON = "services";
const std::string JOBS_ARR_NAME_IN_JSON = "jobs";
......@@ -62,7 +62,7 @@ const int TEST_MAX_PATH_ARGS_CNT = 20; // max path and args count
const int TEST_MAX_ONE_ARG_LEN = 64; // max length of one param/path
const int CAT_BUF_SIZE = 512; // standard Cat buffer size from vfs_shell_cmd
// job test releated
// job test related
const std::string PRE_INIT_DIR = ROOT_DIR + "preInitDir/";
const std::string INIT_DIR = PRE_INIT_DIR + "initDir";
const std::string POST_INIT_DIR = INIT_DIR + "postInitDir";
......
......@@ -63,7 +63,7 @@ static const char *forbitWriteParamName[] = {
static int TestSetParamCheck(const char *paraName, struct ucred *uc)
{
// forbit to read ohos.servicectrl.
// forbid to read ohos.servicectrl.
for (size_t i = 0; i < ARRAY_LENGTH(forbitWriteParamName); i++) {
if (strncmp(paraName, forbitWriteParamName[i], strlen(forbitWriteParamName[i])) == 0) {
return 1;
......@@ -91,7 +91,7 @@ static const char *forbitReadParamName[] = {
};
static int TestReadParamCheck(const char *paraName)
{
// forbit to read ohos.servicectrl.
// forbid to read ohos.servicectrl.
for (size_t i = 0; i < ARRAY_LENGTH(forbitReadParamName); i++) {
if (strncmp(paraName, forbitReadParamName[i], strlen(forbitReadParamName[i])) == 0) {
return 1;
......@@ -415,4 +415,4 @@ static __attribute__((constructor(101))) void ParamTestStubInit(void)
#if __cplusplus
}
#endif
#endif
\ No newline at end of file
#endif
......@@ -447,7 +447,7 @@ public:
int TestServiceCtrl(const char *serviceName, int mode)
{
// service forbit
// service forbid
ParamAuditData auditData = {};
auditData.name = "ohos.servicectrl.";
auditData.dacData.gid = 202; // 202 test dac gid
......@@ -459,7 +459,7 @@ public:
int TestPowerCtrl(const char *reboot, int mode)
{
// service forbit
// service forbid
ParamAuditData auditData = {};
auditData.name = "ohos.servicectrl.";
auditData.dacData.gid = 202; // 202 test dac gid
......@@ -573,4 +573,4 @@ HWTEST_F(ParamServiceUnitTest, TestPowerCtrl, TestSize.Level0)
ret = test.TestPowerCtrl("reboot", 0772);
EXPECT_EQ(ret, 0);
}
} // namespace init_ut
\ No newline at end of file
} // namespace init_ut
......@@ -62,7 +62,7 @@ HWTEST_F(SysparaUnitTest, parameterTest001_1, TestSize.Level0)
printf("SDK api version =%d\n", GetSdkApiVersion());
printf("Incremental version = %s\n", GetIncrementalVersion());
printf("formal id =%s\n", GetVersionId());
printf("build tyep =%s\n", GetBuildType());
printf("build type =%s\n", GetBuildType());
printf("build user =%s\n", GetBuildUser());
printf("Build host = %s\n", GetBuildHost());
printf("build time =%s\n", GetBuildTime());
......
......@@ -25,10 +25,10 @@ const.allow.mock.location root:root:0777
const.debuggable root:root:0777
persist.sys.usb.config root:root:0777
# default forbit other user to start service
# default forbid other user to start service
ohos.servicectrl. root:root:0777
test.permission. root:root:0770
test.permission.read. root:root:0774
test.permission.write. root:root:0772
test.permission.watcher. root:root:0771
\ No newline at end of file
test.permission.watcher. root:root:0771
......@@ -25,5 +25,5 @@ const.allow.mock.location root:root:0777
const.debuggable root:root:0777
persist.sys.usb.config root:root:0777
# default forbit other user to start service
ohos.servicectrl. root:root:0777
\ No newline at end of file
# default forbid other user to start service
ohos.servicectrl. root:root:0777
......@@ -36,7 +36,7 @@ function hdc_push_cmd() {
if [ $# -ne 2 ];then
return;
fi
echo "Pushing resouces to device"
echo "Pushing resources to device"
hdc file send $@
sleep 0.2
}
......
......@@ -169,7 +169,7 @@ static void HandleRequiredDynamicDeviceNodes(const struct Uevent *uevent)
static void HandleUeventRequired(const struct Uevent *uevent, char **devices, int num)
{
const char *deviceName;
INIT_ERROR_CHECK(devices != NULL && num > 0, return, "Fault paramters");
INIT_ERROR_CHECK(devices != NULL && num > 0, return, "Fault parameters");
if (uevent->action == ACTION_ADD) {
ChangeSysAttributePermissions(uevent->syspath);
}
......@@ -332,7 +332,7 @@ static void Trigger(const char *path, int sockFd, char **devices, int num)
}
char ueventBuffer[PATH_MAX];
if (snprintf_s(ueventBuffer, PATH_MAX, PATH_MAX - 1, "%s/%s", path, "uevent") == -1) {
INIT_LOGW("Cannnot build uevent path under %s", path);
INIT_LOGW("Cannot build uevent path under %s", path);
continue;
}
DoTrigger(ueventBuffer, sockFd, devices, num);
......
......@@ -307,7 +307,7 @@ static char **GetBlockDeviceSymbolLinks(const struct Uevent *uevent)
return NULL;
}
// Reverse walk through sysPath, and check subystem file under each directory.
// Reverse walk through sysPath, and check subsystem file under each directory.
char *parent = dirname(sysPath);
while (parent != NULL && !STRINGEQUAL(parent, "/") && !STRINGEQUAL(parent, ".")) {
char subsystem[SYSPATH_SIZE];
......
......@@ -155,7 +155,7 @@ static int ParseFirmwareConfig(char *p)
// Sanity checks
struct stat st = {};
INIT_ERROR_CHECK(stat(p, &st) == 0, return -1, "Invalid firware file: %s, err = %d", p, errno);
INIT_ERROR_CHECK(stat(p, &st) == 0, return -1, "Invalid firmware file: %s, err = %d", p, errno);
INIT_ERROR_CHECK(S_ISDIR(st.st_mode), return -1, "Expect directory in firmware config");
struct FirmwareUdevConf *config = calloc(1, sizeof(struct FirmwareUdevConf));
INIT_CHECK(config != NULL, errno = ENOMEM;
......
......@@ -39,7 +39,7 @@ int UeventdSocketInit(void)
int on = 1;
if (memset_s(&addr, sizeof(addr), 0, sizeof(addr)) != EOK) {
INIT_LOGE("Faild to clear socket address");
INIT_LOGE("Failed to clear socket address");
return -1;
}
addr.nl_family = AF_NETLINK;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册